/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrameMovimento.java
 *
 * Created on 13/09/2011, 21:01:53
 */
package br.com.GUI.caixa;

import br.com.GUI.cadastro.*;
import br.com.classes.*;
import br.com.dao.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.MaskFormatter;
import javax.swing.text.PlainDocument;
import org.jdesktop.swingx.combobox.ListComboBoxModel;

/**
 *
 * @author Kauane
 */
public class FrameMovimento extends javax.swing.JFrame {

    java.text.DateFormat datas;
    Date data_hj = new Date(); // data atual
    int codigousu;
    int codigo_novocaixa;
    int linhadatabela = 0; // linha da tabela movimento selecionada
    int nu;
    int novo=1; // variavel que controla o codigo dos cheques novos na lista
    int cod_cheque;
    int indiceTabelaCh;
    int variavelglobal;
    int desejalancaroutro = 0; //se ==0 não estamos em "lançando em outro caixa"
    int indexCaixa = -1;
    int paginacao;
    int num = 0;
    int limitepesquisacheque = 0;
    int cod_historico_edita;
    int cod_mov;
    int ultimomovimento;
    int atualizahistorico = 0;
    String user;
    String novohistorico;
    String[] names = {""};
    String ControlAlteraCadastra = "1"; //Variavel que controla o funcionamento do botão alterar
    String nomebanco;
    String combouppercase;
    List<Caixa> lista = null;
    List<Cheque> listacheque = null;
  
    List<Movimento> listamovimento = null;
    ArrayList<Integer> valores = new ArrayList<Integer>();
    ArrayList<Integer> listacaixa = new ArrayList<Integer>();
    ArrayList CaixasLancados = new ArrayList(); // lista de caixas que já receberam lançamentos
    ArrayList<Cheque> ChequesCadastrados = new ArrayList<Cheque>();
    Cheque cheque = new Cheque(); //   
    FrameEntidade JanelaEntidade = new FrameEntidade();
    FrameCaixa JanelaCaixa = new FrameCaixa();
    FrameCheque JanelaCheque = new FrameCheque();
    FrameBanco JanelaBanco = new FrameBanco();
    FrameHistorico JanelaHistorico = new FrameHistorico();
    FrameUsuario JanelaUsuario = new FrameUsuario();
    DefaultTableModel modelo2 = null;
    DefaultTableModel modelock = null;
    MaskFormatter cp = null;
    MaskFormatter DDD = null;
    MaskFormatter Cpf = null;
    MaskFormatter CNPJ = null;
    MaskFormatter Tel = null;
    MaskFormatter Rg = null;
    MaskFormatter Uf = null;
    

    /**
     * Creates new form FrameMovimento
     */
    public FrameMovimento(String loginp, String userp, int codusu) {

        initComponents();
        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        if (userp.equals(0 + "")) { // Mostra se é um usuario ou administrador na tela
            user = "Administrador";
        } else {
            user = "Usuário";
        }
        jLabel3.setText("Tipo: " + user + "          Nome: " + loginp); // Mostra o usuario e o nome
        jLabel10.setText("Data do Movimento: " + dateFormat.format(data_hj)); // Mostra a data atual
        CarregarCaixa(); // Carrega os caixas
        CarregarTipo(); // Carrega os tipos fornecedor, cliente      
        CarregarHistorico(); // Carrega a tabela com os Historicos
        CarregarEntidade(); // Carrega a tabela Entidade
        CarregarBanco(); // Carrega a tabela Banco
        CarregaTabelaChequePagar(); // Carrega a tabela com os cheques para movimento de saida
        CarregarCaixaNovo(); // Carrega a tabela caixa novo
        //CarregarCheque(); // Carrega os cheques cadastrados
        DataAtual(); // Carrega a jDate do movimento com  a data atual
        ListaHistorico(); // Lista os historicos no cbox 
        //Decorate();
        jTableConsultaCheque.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 
        codigousu = codusu;
        buttonGroup1.add(jRadioButton_Credito);
        buttonGroup1.add(jRadioButton_Debito);
        jTextField_Pagamento.setEditable(false);
        jTextField_Nome_Pagamento.setEditable(false);
        jButtonPagamento.setEnabled(true);
        jButton_Deletar.setEnabled(false);
        jMoneyFieldValor.setEnabled(false);
        jButtonNovoLancamento.setEnabled(false);
        
        cBox.getEditor().setItem("");
        
        if (user.equals("Usuário")) {

            jButtonCadastrarHistorico.setEnabled(false);
            jButtonNovoEntidade.setEnabled(false);
        }
        jTableChequeCadastro.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 
    }
    
    

    private FrameMovimento() {
    }

    // funcao para deixar as letras maiuculas
    public class LetraMaiuscula extends PlainDocument {

        @Override
        public void insertString(int offset, String str, AttributeSet attr)
                throws BadLocationException {
            super.insertString(offset, str.toUpperCase(), attr);
        }
    }
       

//    public class LetraMaiuscula2 extends PlainDocument {
//
//        @Override
//        public void insertString(int offset, String str, AttributeSet attr)
//                throws BadLocationException {
//            super.insertString(offset, str.toUpperCase(), attr);
//        }
//    }
    
    public Cheque GetCheque (int codcheque)
    {
        Cheque chequeDevolv = new Cheque();
        
        for (int i = 0; i < ChequesCadastrados.size(); i++) {
            if (ChequesCadastrados.get(i).getCod_cheque() == codcheque ){
                chequeDevolv = ChequesCadastrados.get(i);
            }
        }
        
        return chequeDevolv;
    }
    
        public Boolean ChequeisTrue (int codcheque)
    {
      Boolean x=false;
        
        for (int i = 0; i < ChequesCadastrados.size(); i++) {
            if (ChequesCadastrados.get(i).getCod_cheque() == codcheque ){
                 x= true;
            }
        }
        return x;
       
    }
    
    public  void SetCheque(int codcheque, Cheque cheque){

       for (int i = 0; i < ChequesCadastrados.size(); i++) {

            if (ChequesCadastrados.get(i).getCod_cheque() == codcheque ){
               ChequesCadastrados.set(i, cheque);
            }
        }  
 
    }
    
        public  void DelCheque(int codcheque){

       for (int i = 0; i < ChequesCadastrados.size(); i++) {

            if (ChequesCadastrados.get(i).getCod_cheque() == codcheque ){ 
                ChequesCadastrados.remove(i);
            }
        }           
    }
    
    
    
    
        public void CarregarLetraCheque() {
        String caixa = jTextFieldPesquisar.getText();
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
        ChequeDao cdao = new ChequeDao();
        List<Cheque> listaconsultacheque = cdao.ProcurarChequeLetra(caixa);

        DefaultTableModel modelo = (DefaultTableModel) jTableConsultaCheque.getModel();
        modelo.setRowCount(0);

        for (Cheque cx : listaconsultacheque) {
        String data = cx.getData();   
        try{
        Date dataformatada; 
        dataformatada = formatoBanco.parse(data);
        String datafor = formato.format(dataformatada);  
            
         modelo.addRow(new Object[]{cx.getCod_cheque(), cx.getEntrada_ck(), cx.getSaida_ck(), cx.getBanco(), cx.getAgencia(), cx.getConta(), cx.getNum_cheque(), datafor, cx.getDevolvido(), cx.getValor_cheque(), cx.getEmitente()});
        
        }catch(ParseException ex) {
                Logger.getLogger(FrameCheque.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaLetraCheque");
}}
        jTableConsultaCheque.setModel(modelo);
    }
    
//       public void CarregarCheque( List<Cheque> listack) {
//        
//        ChequeDao cdao = new ChequeDao();
//       SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
//       SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
//        listack = cdao.ListarCheque();
//        DefaultTableModel modelo = (DefaultTableModel) jTableConsultaCheque.getModel();
//        modelo.setRowCount(0);
//
//        for (Cheque cx : listack) {
//            String data = cx.getData();
//
//            try {
//                Date dataformatada; 
//                dataformatada = formatoBanco.parse(data);
//                String datafor = formato.format(dataformatada); 
//                modelo.addRow(new Object[]{cx.getCod_cheque(), cx.getEntrada_ck(), cx.getSaida_ck(), cx.getBanco(), cx.getAgencia(), cx.getConta(), cx.getNum_cheque(), datafor, cx.getDevolvido(), cx.getValor_cheque(), cx.getEmitente()});
//       } catch (ParseException ex) {
//                Logger.getLogger(FrameCheque.class.getName()).log(Level.SEVERE, null, ex);
//                JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaCheque");
//            }  
//            }
//        jTableConsultaCheque.setModel(modelo);
//    }     
       
       /**
        * Carrega a tabela de cheque
        * 
        * @param listack 
        */
     public void CarregarChequePesquisaAvancada( List<Cheque> listack ) {
        
       SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
       SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
       DefaultTableModel modelo = (DefaultTableModel) jTableConsultaCheque.getModel();
       modelo.setRowCount(0);

        for (Cheque cx : listack) {
            String data = cx.getData();

            try {
                Date dataformatada; 
                dataformatada = formatoBanco.parse(data);
                String datafor = formato.format(dataformatada); 
                modelo.addRow(new Object[]{cx.getCod_cheque(), cx.getEntrada_ck(), cx.getSaida_ck(), cx.getBanco(), cx.getAgencia(), cx.getConta(), cx.getNum_cheque(), datafor, cx.getDevolvido(), cx.getValor_cheque(), cx.getEmitente()});
       } catch (ParseException ex) {
                Logger.getLogger(FrameCheque.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaCheque");
            }  
            }
        jTableConsultaCheque.setModel(modelo);
    }      
       
        
     public void CarregarCaixaNovo() {
        CaixaDao cdao = new CaixaDao();
        List<Caixa> listacaixanovo = cdao.ListarCaixa();
        DefaultTableModel modelo = (DefaultTableModel) jTableCaixaNovo.getModel();
        modelo.setRowCount(0);

        for (Caixa c : listacaixanovo) {
            modelo.addRow(new Object[]{c.getCod_caixa(), c.getCaixa(), c.getCxRazaoSocial(), c.getCxEndereco(), c.getCxCidade(), c.getCxRegistro(), c.getCxRespLegal(), c.getCxContador(), c.getCxNomeEmp()});
        }
        jTableCaixaNovo.setModel(modelo);
    }   

    //Cadastra Cheque
    public void CadastraCheque(ArrayList<Cheque> ChequesCadastrado){
      
        for(int x=0; x< ChequesCadastrado.size(); x++){      
           ChequeDao cdao = new ChequeDao();
            try {
                cdao.CadastrarCheque(ChequesCadastrado.get(x), ultimomovimento);
            } catch (Exception ex) {
                Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, "Funcao do Movimento CadastraCheque", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);
            }
        } 
    }
    
        public void CadastraOutroCheque(ArrayList<Cheque> ChequesCadastrado, int movimentoatual){
      
        for(int x=0; x< ChequesCadastrado.size(); x++){      
            //ChequesCadastrado.set(x, cheque).setEntrada_ck(codmov);
           ChequeDao cdao = new ChequeDao();          
            try {          
                cdao.CadastrarCheque(ChequesCadastrado.get(x), movimentoatual);
            } catch (Exception ex) {
                Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, "Funcao do Movimento CadastraOutroCheque", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);
            }
        } 
    }
    
    
        // classe autocompletar
    public class AutoComplete extends JComboBox implements JComboBox.KeySelectionManager {

        private String searchFor;
        private long lap;

        public class CBDocument extends PlainDocument {

            @Override
            public void insertString(int offset, String str, AttributeSet a) throws BadLocationException {
                if (str == null) {
                    return;
                }
                super.insertString(offset, str, a);
                if (!isPopupVisible() && str.length() != 0) {
                    fireActionEvent();
                }
            }
        }

        public AutoComplete(Object[] items) {
            super(items);
            lap = new java.util.Date().getTime();
            setKeySelectionManager(this);
            JTextField tf;
            if (getEditor() != null) {
                tf = (JTextField) getEditor().getEditorComponent();
                if (tf != null) {
                    tf.setDocument(new AutoComplete.CBDocument());
                    addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent evt) {
                            JTextField tf = (JTextField) getEditor().getEditorComponent();
                            String text = tf.getText();
                            ComboBoxModel aModel = getModel();
                            String current;
                            for (int i = 0; i < aModel.getSize(); i++) {
                                current = aModel.getElementAt(i).toString();
                                if (current.toLowerCase().startsWith(text.toLowerCase())) {
                                    tf.setText(current);
                                    tf.setSelectionStart(text.length());
                                    tf.setSelectionEnd(current.length());
                                    break;
                                }
                            }
                        }
                    });
                }
            }
        }

        @Override
        public int selectionForKey(char aKey, ComboBoxModel aModel) {
            long now = new java.util.Date().getTime();
            if (searchFor != null && aKey == KeyEvent.VK_BACK_SPACE && searchFor.length() > 0) {
                searchFor = searchFor.substring(0, searchFor.length() - 1);
            } else {
                //	System.out.println(lap);
                // Kam nie hier vorbei.
                if (lap + 1000 < now) {
                    searchFor = "" + aKey;
                } else {
                    searchFor = searchFor + aKey;
                }
            }
            lap = now;
            String current;
            for (int i = 0; i < aModel.getSize(); i++) {
                current = aModel.getElementAt(i).toString().toLowerCase();
                if (current.toLowerCase().startsWith(searchFor.toLowerCase())) {
                    return i;
                }
            }
            return -1;
        }

        @Override
        public void fireActionEvent() {
            super.fireActionEvent();
        }
    }
    
    public void PreencheoNomedaEntidade(){             
        
        EntidadeDao entd = new EntidadeDao();
        if (jTextField_CodigoMov.getText().equals("")) {
            
        } else {
            int cod_ent = Integer.parseInt(jTextField_CodigoMov.getText());

            String nome = entd.ListarEntidadeNome(cod_ent);
            jTextField_NomeMov.setText(nome);
            if (jTextField_NomeMov.getText().equals("")) {
                JOptionPane.showMessageDialog(null, "Codigo Inexistente! \nAdicione um codigo válido!");
                jTextField_CodigoMov.setText("");
                jTextField_CodigoMov.requestFocus();
            }
        }
    }
    
    
    public void HistoricoMaiusculo(String historico){
        
      if(cBox.getSelectedItem()== (null)){        
       }else{
           combouppercase = historico;
      combouppercase.toUpperCase();
      cBox.setSelectedItem(combouppercase);
       }
        
    }
    
    // Carrega o jDateChooser1 com a data atual
    public void DataAtual() {

        try {
            SimpleDateFormat formatIso = new SimpleDateFormat("dd/MM/yyyy");
            DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            String dataatual = dateFormat.format(data_hj); // passa a data atual para String  
            Date date = formatIso.parse(dataatual);  // Passa a String para Date
            jDateChooser1.setDate(date); // Passa para o jDateChooser a variavel Date com a data atual
           } catch (ParseException ex) {
            Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "Funcao do Movimento DataAtual", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);
        }
    }
    
    // Carrega o jDateChooser do cheque com a data atual
    public void DataAtualCheque(){
       
        try {
            SimpleDateFormat formatIso = new SimpleDateFormat("dd/MM/yyyy");
            DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
            String dataatual = dateFormat.format(data_hj); // passa a data atual para String  
            Date date = formatIso.parse(dataatual);  // Passa a String para Date   
            jDateChooserChequeCadastro.setDate(date); // Passa para o jDateChooser do cheque a variavel Date com a data atual
        } catch (ParseException ex) {
            Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, "Funcao do Movimento DataAtualCheque", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);      
        }
    }
    

    //Carrega Cheque Cadastrados na Tabela jTableChequeCadastro
    private void CarregaTabelaChequeCadastro() {

       SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
       SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
        DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
        DefaultTableModel modelocheque = (DefaultTableModel) jTableChequeCadastro.getModel();
        modelocheque.setRowCount(0);
        modelo2.setRowCount(0);
        
        for (int i = 0; i < ChequesCadastrados.size(); i++) {
            String a = ChequesCadastrados.get(i).getData();
      
              try {
                if(a==null){
                    
                }else{  
             
                Date dataformatada; 
                dataformatada = formatoBanco.parse(a);
                String datafor = formato.format(dataformatada);
                modelocheque.addRow(new Object[]{ChequesCadastrados.get(i).getCod_cheque(), ChequesCadastrados.get(i).getAgencia(), ChequesCadastrados.get(i).getConta(), ChequesCadastrados.get(i).getNum_cheque(), ChequesCadastrados.get(i).getBanco(), ChequesCadastrados.get(i).getEmitente(), datafor, ChequesCadastrados.get(i).getDevolvido(), FormataTable.format(ChequesCadastrados.get(i).getValor_cheque()), ChequesCadastrados.get(i).getComp()});    
                }
                modelo2.addRow(new Object[]{ChequesCadastrados.get(i).getCod_cheque(), ChequesCadastrados.get(i).getEmitente(), FormataTable.format(ChequesCadastrados.get(i).getValor_cheque()), ChequesCadastrados.get(i).getStatus()});        
  
            } catch (ParseException ex) {
                Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaTabelaChequeCadastro", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);
            }         
        }
    }

    //Carrega a tabela dos cheques que pagaram os movimento. E carrega a outro tabela com os dados dos cheque assim que clica na tabela
    public void CarregaChequePagar() {

        try {
            if (jTableChequePagar.getSelectedColumn() == 8) { // se o clik for igual a um e na coluna 8(checkbox) faz o codigo abaixo        
          for (int j = 0; j < jTableChequePagar.getRowCount(); j++) {
                          
                    if ((Boolean) jTableChequePagar.getValueAt(j, 8) == true) {
                        
                        Cheque chequel = new Cheque();
                      //Boolean chebox = (Boolean) jTableChequePagar.getValueAt(j, 8);                      
                        String cod = jTableChequePagar.getValueAt(j, 0).toString();
                        chequel.setCod_cheque(Integer.parseInt(cod));                      
                      //chequel.setAgencia(jTableChequePagar.getValueAt(j, 1).toString());
                      //chequel.setConta(jTableChequePagar.getValueAt(j, 2).toString());
                      //chequel.setNum_cheque(jTableChequePagar.getValueAt(j, 3).toString());
                      //chequel.setBanco(jTableChequePagar.getValueAt(j, 4).toString());
                      //String origem = jTableChequePagar.getValueAt(j, 5).toString();                      
                        chequel.setEmitente(jTableChequePagar.getValueAt(j, 5).toString());                      
                      //chequel.setDevolvido(jTableChequePagar.getValueAt(j, 6).toString());
                        String valor = (String) jTableChequePagar.getValueAt(j, 7);
                        valor = valor.replace(".", "");
                        valor = valor.replace(",", ".");
                        chequel.setValor_cheque(Double.parseDouble(valor));
                        chequel.setStatus("Novo");
                      //String listae = cdao.ListarEntidadeNomePorCheque(cod);
                      //ChequeisTrue(chequel.getCod_cheque());
                        if(!ChequeisTrue(chequel.getCod_cheque())){
                            ChequesCadastrados.add(chequel); 
                        }                        
                     CarregaTabelaChequeCadastro(); 
                        //modelo2.addRow(new Object[]{cod, c.getNum_cheque(), c.getValor_cheque()});                      
                    }else{
                   int indice2 = (Integer)jTableChequePagar.getValueAt(j, 0);
                  DelCheque(indice2);
                  CarregaTabelaChequeCadastro();
                    }
               }
             // CarregaTabelaChequeCadastro();                       
            } else{
   
            }
        } catch (Exception ex) {
            System.out.println("1 - CarregaChequePagar - " + ex.getMessage());
            //JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaChequePagar", "Mensagem de ERRO", JOptionPane.ERROR_MESSAGE);
        }
    }

    //Altera o movimento de saida do cheque quando for um pagamento
    public void AlteraSaidaDoCheque(int ultimocodmov) {

        ChequeDao cdao = new ChequeDao();
        for (int i = 0; i < ChequesCadastrados.size(); i++) {
        cdao.AlterarSaidaCheque(ChequesCadastrados.get(i).getCod_cheque(), ultimocodmov);
        }
       
    }
    
        public void AlteraSaidaDoChequeUpdate(int codcheque) {
        MovimentoDao mdao = new MovimentoDao();
        ChequeDao cdao = new ChequeDao();
        int ultimo_cod_mov = mdao.UltimoCodMov();      
        cdao.AlterarSaidaCheque(codcheque, ultimo_cod_mov);
    
    }
    

//Carrega a tabela do cheque de acordo com o movimento
    public void ChequeMovimentoOrigem(int codmov) {

        ChequeDao cdao = new ChequeDao();
        MovimentoDao mdao = new MovimentoDao();
        EntidadeDao edao = new EntidadeDao();
        ChequesCadastrados = cdao.BuscarChequeMovOrigem(codmov);
    }

    //Carrega a tabela do cheque de acordo com o movimento
    public void ChequeMovimentoDestino(int codmov) {
        ChequeDao cdao = new ChequeDao();
        MovimentoDao mdao = new MovimentoDao();
        EntidadeDao edao = new EntidadeDao();
        ChequesCadastrados = cdao.BuscarChequeMovDestino(codmov);
    }

    //Pega os valores do formulario de PesquisaCheque e devolve o objeto PesquisaCheque
    public PesquisaCheque GetValorePesquisaCheque() {
 
        PesquisaCheque e = new PesquisaCheque();
        try
        {
         e.setComp(jTextFieldComp.getText());
         e.setBanco(jTextFieldBanco.getText());
         if(jTextFieldCodigoCheque.getText().equals("")){     
             e.setCod_cheque(0);
         }else{
             e.setCod_cheque(Integer.parseInt(jTextFieldCodigoCheque.getText()));            
         }
         e.setAgencia(jTextFieldAgencia.getText());
         e.setConta(jTextFieldConta.getText());
         e.setNum_cheque(jTextFieldNumCheque.getText());
         e.setDevolvido(jComboBox1.getSelectedItem().toString());
         e.setValor_cheque(Double.parseDouble(jMoneyFieldChequePesquisa.getText()));

         Date data = (jDatePreInicial.getDate());
         String DatapreInicial = "";
         String DatapreFim = "";
         if(jDatePreInicial.getDate() != null){
         DatapreInicial = FormataDataParaBd(jDatePreInicial.getDate());
         }
         if(jDatePreFinal.getDate() != null){
         DatapreFim = FormataDataParaBd(jDatePreFinal.getDate());
         }       
         if ((!DatapreInicial.equals("") && DatapreFim.equals(""))|| (DatapreInicial.equals("") && !DatapreFim.equals(""))) {
            JOptionPane.showMessageDialog(null, " Por favor preencha a Data inicial e final "); 
            jDatePreInicial.setDate(null);
            jDatePreFinal.setDate(null);
         }
         e.setDataini(DatapreInicial);         
         e.setDataFim(DatapreFim);
         e.setEmitente(jTextFieldEmitentePesquisa.getText());
         
         String DataEntradaIni= "";
         String DataEntradaFim = "";    
         if(jDateEntradaInicial.getDate() != null){
         DataEntradaIni = FormataDataParaBd(jDateEntradaInicial.getDate());
         }
         if(jDateEntradaFinal.getDate() != null){
         DataEntradaFim = FormataDataParaBd(jDateEntradaFinal.getDate());
         }    
         if ((!DataEntradaIni.equals("") && DataEntradaFim.equals(""))|| (DataEntradaIni.equals("") && !DataEntradaFim.equals(""))) {
            JOptionPane.showMessageDialog(null, " Por favor preencha a Data inicial e final ");    
            jDateEntradaInicial.setDate(null);
            jDateEntradaFinal.setDate(null);
         }
         e.setDataEntradaIni(DataEntradaIni);
         e.setDataEntradaFim(DataEntradaFim);
         
         String DataSaidaIni = "";
         String DataSaidaFim = "";
         if(jDateSaidaInicial.getDate() != null){
         DataSaidaIni = FormataDataParaBd(jDateSaidaInicial.getDate());
         }
         if(jDateSaidaFinal.getDate() != null){
         DataSaidaFim = FormataDataParaBd(jDateSaidaFinal.getDate());
         } 
         if ((!DataSaidaIni.equals("") && DataSaidaFim.equals(""))|| (DataSaidaIni.equals("") && !DataSaidaFim.equals(""))) {
            JOptionPane.showMessageDialog(null, " Por favor preencha a Data inicial e final ");            
         }
          e.setDataSaidaIni(DataSaidaIni);
          e.setDataSaidaFim(DataSaidaFim);    
        }catch(Exception ex) {
            System.out.println("1 - GetValorePesquisaCheque - " + ex.getMessage());
        }
          return e;     
    }

    //converte double em decimal
    public static double converterDoubleDoisDecimais(double precoCredito, double precoDebito) {

        DecimalFormat fmt = new DecimalFormat("0.00");
        String string = fmt.format(precoCredito);
        String strin = fmt.format(precoDebito);
        String[] part = string.split("[,]");
        String[] par = strin.split("[,]");
        String string2 = part[0] + "." + part[1];
        String strin2 = par[0] + "." + par[1];
        double preco = Double.parseDouble(string2);
        double prec = Double.parseDouble(strin2);
        return prec;
    }

    //Limpa a tabela do Movimento
    public void LimparTelaMovimento() {

        jDateChooser1.setDate(null);
        jTextField_CodigoMov.setText("");
        cBox.setSelectedItem(null);
        jTextField_NomeMov.setText("");
        jMoneyFieldValor.setText("");
        jTextField_Pagamento.setText("");
        jTextField_Nome_Pagamento.setText("");
        cBox.setSelectedItem("");
        jRadioButton_Credito.setSelected(false);
        jRadioButton_Debito.setSelected(false);
        jTableChequesMovimento.setModel(modelo2);
        cBox.getEditor().setItem("");
        jMoneyFieldValor.setEnabled(true);
        jButton_Lancar.setText("Lançar");
        Lancamento.setText("Novo Lançamento");
        modelo2.setRowCount(0);
//        jComboBox_Pagamento.setEnabled(true);
//        jComboBox_Tipo.setEnabled(true);
//        cod_mov=0;
//        jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
//        jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
    }

//    //funcao que carrega o Cheque do JdialogListaCheque
//    public void CarregarChequeJdialog() {
//
//        ChequeDao cdao = new ChequeDao();
//        List<Cheque> listc = cdao.ListarChequeMov();
//        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
//        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco  
//        DefaultTableModel modelo = (DefaultTableModel) jTableChequeCadastro.getModel();
//        modelo.setRowCount(0);
//        for (Cheque cx : listc) {
//
//            try {
//                String data = cx.getData();
//                Date date;
//                date = formatoBanco.parse(data);
//                String dataformatadat = formato.format(date);
//                DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
//
//                modelo.addRow(new Object[]{cx.getCod_cheque(), cx.getAgencia(), cx.getConta(), cx.getNum_cheque(), cx.getBanco(), cx.getEmitente(), dataformatadat, cx.getDevolvido(), FormataTable.format(cx.getValor_cheque())});
//            } catch (ParseException ex) {
//                Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
//                JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaTabelaChequeCadastro");
//            }
//        }
//        jTableChequeCadastro.setModel(modelo);
//    }

    public String FormataValor(Double valor) {

        java.text.NumberFormat nf = java.text.NumberFormat.getNumberInstance();
        nf.setMinimumFractionDigits(2);
        nf.setMaximumFractionDigits(2);
        String strValorFormatado = nf.format(valor);
        return strValorFormatado;
    }

    public void SomaChequesMov() { //soma os cheque que foram add na jTable2 no Movimento

        double soma = 0;
        int contador = jTableChequesMovimento.getRowCount();

      //  for (int u = 0; u < contador; u++) {
            
        for (int i = 0; i < ChequesCadastrados.size(); i++) {
            String valor = ChequesCadastrados.get(i).getValor_cheque().toString();
            System.out.println(ChequesCadastrados.get(i).getValor_cheque().toString()+" Este e o valor ");
           // String valor = (String) String.valueOf(jTableChequesMovimento.getValueAt(u, 2).toString());
//            valor = valor.replace(".", "");
//            valor = valor.replace(",", ".");
            Double soma2 = Double.parseDouble(valor);
            soma = soma + soma2;
        }
        String a = FormataValor(soma);
        jMoneyFieldValor.setValue(a);
    }

    /**
     * Formata Data para formato do banco
     * Ex: 04-08-2012 -> 2012-08-04
     */
    public String FormataDataParaBd(Date data){
        System.out.println(data +"  data");
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
        String dataformatada = formatoBanco.format(data);
        System.out.println(dataformatada+"  forma");
        return dataformatada;
        
    }
    
    
    //funcao que carrega o Cheque que vai pagar o movimento
    public void CarregaTabelaChequePagar() {

        ChequeDao cdao = new ChequeDao();
        List<Cheque> listc = cdao.ListarChequeMov();
        modelock = (DefaultTableModel) jTableChequePagar.getModel();
        modelock.setRowCount(0);

        for (Cheque cx : listc) {
            DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
          //String Emitente = cdao.ListarEntidadeNomePorCheque(cx.getCod_cheque());

            modelock.addRow(new Object[]{cx.getCod_cheque(), cx.getAgencia(), cx.getConta(), cx.getNum_cheque(), cx.getBanco(), cx.getEmitente(), cx.getDevolvido(), FormataTable.format(cx.getValor_cheque())});
        }
        for (int h = 0; h < modelock.getRowCount(); h++) {
            modelock.setValueAt(false, h, 8);
        }
        jTableChequePagar.setModel(modelock);
    }

    //funcao que carrega o saldo de acordo com o Caixa
    public void CarregaSaldo() {
                
        Caixa cx; // Cria um novo objeto caixa 
        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox 
        MovimentoDao mdao = new MovimentoDao();
        Double saldu = mdao.ListarSaldoCaixa(cx.getCod_caixa());
        DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
        String sal = FormataTable.format(saldu);  
        jTextField_Saldo.setText(sal);

    }

    //funcao que carrega o jDialigHistorico
    public void CarregarHistorico() {
        HistoricoDao bdao = new HistoricoDao();
        List<Historico> listah = bdao.ListarHistoricos();
        DefaultTableModel modelo = (DefaultTableModel) jTableHistorico.getModel();
        modelo.setRowCount(0);
        for (Historico h : listah) {
            modelo.addRow(new Object[]{h.getCod_historico(), h.getHistorico()});
        }
        jTableHistorico.setModel(modelo);
    }

    //funçao que carrega o Banco no JdialogListaBanco   
    public void CarregarBanco() {
        BancoDao bdao = new BancoDao();
        List<Banco> list = bdao.ListarBanco();
        DefaultTableModel modelo = (DefaultTableModel) jTableBanco.getModel();
        modelo.setRowCount(0);
        for (Banco b : list) {
            modelo.addRow(new Object[]{b.getCod_banco(), b.getBanco(), b.getAgencia(), b.getConta()});
        }
        jTableBanco.setModel(modelo);
    }

    //funcão que carrega a entidade no JdialogListaEntidade
    public void CarregarEntidade() {
        EntidadeDao edao = new EntidadeDao();
        List<Entidade> list1 = edao.ListarEntidade();
        DefaultTableModel modelo = (DefaultTableModel) jTableEntidadeCheque.getModel();
        DefaultTableModel modelo1 = (DefaultTableModel) jTableEntidade.getModel();
        modelo.setRowCount(0);
        modelo1.setRowCount(0);

        for (Entidade e : list1) {

            modelo.addRow(new Object[]{e.getCod_ent(), e.getNome_ent(), e.getEnd(), e.getTelefone(), e.getBairro(), e.getObs()});
            modelo1.addRow(new Object[]{e.getCod_ent(), e.getNome_ent(), e.getEnd(), e.getTelefone(), e.getBairro(), e.getObs()});
        }
        jTableEntidadeCheque.setModel(modelo);
        jTableEntidade.setModel(modelo1);
    }

    //funçao que Carrega o Historico no cBox
    public void ListaHistorico() {
       
        HistoricoDao HDao = new HistoricoDao();
        List<String> ListaHistor = HDao.ListarHistoricosMov();
        cBox.setModel(new ListComboBoxModel<String>(ListaHistor));
    }

    // lista os caixas existentes no banco
    public void CarregarCaixa() {
        CaixaDao cdao = new CaixaDao();
        lista = cdao.ListarCaixa();

        for (Caixa c : lista) {
            jComboBox_Caixa.addItem(c.getCaixa());
        }
    }

    // lista os tipos existentes no banco
    public void CarregarTipo() {
        TipoDao tdao = new TipoDao();
        List<Tipo> tlista = tdao.ListarTipo();

        for (Tipo t : tlista) {
            jComboBox_Tipo.addItem(t.getTipo());
        }
    }

    public void CarregarMovimentoLetra() {

        String movimento = jTextField_Pesquisa.getText();
        Caixa cx; // Cria um novo objeto caixa 
        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox 
        MovimentoDao mdao = new MovimentoDao();
        EntidadeDao edao = new EntidadeDao();
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco   
        List<Entidade> listae = edao.ProcurarPorBancoLetra(movimento);
        List<Movimento> mvlista = mdao.ListarMovCaixa(cx.getCod_caixa());
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
        modelo.setRowCount(0);

        for (Movimento m : mvlista) {
            for (Entidade e : listae) {

                if (m.getMov_cod_entidade() == e.getCod_ent()) {
                    String data = m.getData();
                    String datap = m.getData_pre();
                    Date date, datep;
                    try {
                        String tipo = "";
                        date = formatoBanco.parse(data);
                        String dataformatadat = formato.format(date);
                      if (m.getTipo() == 1) {
                            tipo = "Cliente";
                        } else if(m.getTipo() == 2){
                            tipo = "Fornecedor";
                        } else if(m.getTipo() == 3){
                             tipo = "Outros";
                        }
                        DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
                        modelo.addRow(new Object[]{m.getCod_movimento(), e.getCod_ent(), e.getNome_ent(), dataformatadat, m.getMov_historico(), tipo, FormataTable.format(m.getCredito()), FormataTable.format(m.getDebito())});
                     
                    } catch (ParseException ex) {
                        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                        JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregarMovimentoLetra");
                    }
                }
            }
            jTable1.setModel(modelo);
        }
    }

    public void CarregarMovimentoCaixa() {  //Carrega a tabela de acordo com o Caixa selecionado

        int i;
        Caixa cx; // Cria um novo objeto caixa 
        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox 
        MovimentoDao mdao = new MovimentoDao();
        EntidadeDao edao = new EntidadeDao();
        HistoricoDao hdao = new HistoricoDao();
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco      
        List<Entidade> listae = edao.ListarEntidade();
        List<Movimento> listacx = mdao.ListarMovCaixa(cx.getCod_caixa()); // Lista os movimentos de acordo com o caixa
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel(); //intanciando a tabela
        modelo.setRowCount(0);

        for (Movimento m : listacx) {

            for (Entidade e : listae) {

                if (m.getMov_cod_entidade() == e.getCod_ent()) {
                    String data = m.getData();
                    Date date, datep;

                    try {
                        date = formatoBanco.parse(data);          
                        String tipo = "";
                        if (m.getTipo() == 1) {
                            tipo = "Cliente";
                        } else if(m.getTipo() == 2){
                            tipo = "Fornecedor";
                        } else if(m.getTipo() == 3){
                             tipo = "Outros";
                        }
                        DecimalFormat FormataTable = new DecimalFormat("#,##0.00");
                        String dataformatadat = formato.format(date);
                        modelo.addRow(new Object[]{m.getCod_movimento(), e.getCod_ent(), e.getNome_ent(), dataformatadat, m.getMov_historico(), tipo, FormataTable.format(m.getCredito()), FormataTable.format(m.getDebito()), m.getPagamento()});

                    } catch (ParseException ex) {
                        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                        JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregarMovimentoCaixa");
                    }
                }
            }
        }
        jTable1.setModel(modelo);
    }

    public void BuscarLimiteAnterior() { //Faz a paginaçao da tabela

        num = num - 50;
        Caixa cx; // Cria um novo objeto caixa 
        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox 
        MovimentoDao mdao = new MovimentoDao();
        listamovimento = mdao.BuscarLimiteMov(num, cx.getCod_caixa());
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel(); //intanciando a tabela
        modelo.setRowCount(0);

        EntidadeDao edao = new EntidadeDao();
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco      
        List<Entidade> listae = edao.ListarEntidade();

        for (Movimento m : listamovimento) {

            for (Entidade e : listae) {
                if (m.getMov_cod_entidade() == e.getCod_ent()) {
                    String data = m.getData();
                    String datap = m.getData_pre();
                    Date date, datep;
                    String dataformatadapret = null;
                    try {
                        date = formatoBanco.parse(data);
                        if (m.getData_pre() != null) {
                            datep = formatoBanco.parse(datap);
                            dataformatadapret = formato.format(datep);
                        }
                        String dataformatadat = formato.format(date);
                        modelo.addRow(new Object[]{m.getCod_movimento(), e.getCod_ent(), e.getNome_ent(), dataformatadat, dataformatadapret, m.getMov_historico(), m.getTipo(), m.getCredito(), m.getDebito()});

                    } catch (ParseException ex) {
                        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                        JOptionPane.showMessageDialog(null, "Funcao do Movimento BuscarLimiteAnterior");
                    }
                }
            }
        }
        jTable1.setModel(modelo);
        if (listamovimento.size() < 50) {
            jButtonVolta.setEnabled(false);

        } else {
        }
    }

    public void BuscarLimiteProximo() {   //Faz a paginaçao da tabela

        num = num + 50;
        Caixa cx; // Cria um novo objeto caixa 
        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox 
        MovimentoDao mdao = new MovimentoDao();
        listamovimento = mdao.BuscarLimiteMov(num, cx.getCod_caixa());
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel(); //intanciando a tabela
        modelo.setRowCount(0);
        EntidadeDao edao = new EntidadeDao();
        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco      
        List<Entidade> listae = edao.ListarEntidade();
        for (Movimento m : listamovimento) {

            for (Entidade e : listae) {
                if (m.getMov_cod_entidade() == e.getCod_ent()) {

                    String data = m.getData();
                    String datap = m.getData_pre();
                    Date date, datep;
                    String dataformatadapret = null;
                    try {
                        date = formatoBanco.parse(data);
                        if (m.getData_pre() != null) {
                            datep = formatoBanco.parse(datap);
                            dataformatadapret = formato.format(datep);
                        }
                        String dataformatadat = formato.format(date);
                        modelo.addRow(new Object[]{m.getCod_movimento(), e.getCod_ent(), e.getNome_ent(), dataformatadat, dataformatadapret, m.getMov_historico(), m.getTipo(), m.getCredito(), m.getDebito()});

                    } catch (ParseException ex) {
                        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                        JOptionPane.showMessageDialog(null, "Funcao do Movimento BuscarLimiteProximo");
                    }
                }
            }
        }
        jTable1.setModel(modelo);
        if (listamovimento.size() < 50) {
            jButtonAvancar.setEnabled(false);
        }
    }

    public void BuscarLimiteProximoDialog() {
        num = num + 200;

        if (paginacao == 2) {
            EntidadeDao edao = new EntidadeDao();
            List<Entidade> listaent = edao.BuscarLimite(num);
            DefaultTableModel modelo = (DefaultTableModel) jTableEntidade.getModel();
            modelo.setRowCount(0);
            for (Entidade e : listaent) {
                modelo.addRow(new Object[]{e.getCod_ent(), e.getNome_ent(), e.getEnd(), e.getTelefone(), e.getObs()});
            }
            jTableEntidade.setModel(modelo);
        } else if (paginacao == 6) {
            BancoDao bdao = new BancoDao();
            List<Banco> listabc = bdao.BuscarLimite(num);
            DefaultTableModel modelo = (DefaultTableModel) jTableBanco.getModel();
            modelo.setRowCount(0);
            for (Banco b : listabc) {
                modelo.addRow(new Object[]{b.getCod_banco(), b.getBanco(), b.getAgencia(), b.getConta()});
            }
            jTableBanco.setModel(modelo);
        }
    }

    public void BuscarLimiteAnteriorDialog() {
        num = num - 200;
        if (paginacao == 3) {
            EntidadeDao edao = new EntidadeDao();
            List<Entidade> listaent = edao.BuscarLimite(num);
            DefaultTableModel modelo = (DefaultTableModel) jTableEntidade.getModel();
            modelo.setRowCount(0);
            for (Entidade e : listaent) {
                modelo.addRow(new Object[]{e.getCod_ent(), e.getNome_ent(), e.getEnd(), e.getTelefone(), e.getObs()});
            }
            jTableEntidade.setModel(modelo);
        } else if (paginacao == 5) {
            BancoDao bdao = new BancoDao();
            List<Banco> listabc = bdao.BuscarLimite(num);
            DefaultTableModel modelo = (DefaultTableModel) jTableBanco.getModel();
            modelo.setRowCount(0);
            for (Banco b : listabc) {
                modelo.addRow(new Object[]{b.getCod_banco(), b.getBanco(), b.getAgencia(), b.getConta()});
            }
            jTableBanco.setModel(modelo);
        }
    }
    
        public void BuscarLimiteProximoPesquisaAvancadaCheque() {
        
        limitepesquisacheque = limitepesquisacheque + 2;
        if (paginacao == 2) {
            EntidadeDao edao = new EntidadeDao();
            List<Entidade> listaent = edao.BuscarLimite(limitepesquisacheque);
            DefaultTableModel modelo = (DefaultTableModel) jTableEntidade.getModel();
            modelo.setRowCount(0);
            for (Entidade e : listaent) {
                modelo.addRow(new Object[]{e.getCod_ent(), e.getNome_ent(), e.getEnd(), e.getTelefone(), e.getObs()});
            }
            jTableEntidade.setModel(modelo);
        }
        }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jDialogListaEntidade = new javax.swing.JDialog();
        jTextFieldPesquisaEntidadeDialog = new javax.swing.JTextField();
        jButtonOkEntidade = new javax.swing.JButton();
        jLabelPesquisaEntidadeDialog = new javax.swing.JLabel();
        jButtonAtualizaEntidade = new javax.swing.JButton();
        jButtonVoltarEntidade = new javax.swing.JButton();
        jButtonNovoEntidade = new javax.swing.JButton();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTableEntidade = new javax.swing.JTable();
        jButtonProximoEntidade = new javax.swing.JButton();
        jButtonAnteriorEntidade = new javax.swing.JButton();
        jDialogCadEntidade = new javax.swing.JDialog();
        jButtonCadastrarEntidadeMovimento = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jTextFieldCadEntNome = new javax.swing.JTextField();
        jTextFieldCadEntEndereco = new javax.swing.JTextField();
        jTextFieldCadEntBairro = new javax.swing.JTextField();
        jTextFieldCadEntCidade = new javax.swing.JTextField();
        jTextFieldCadEntObs = new javax.swing.JTextField();
        jTextFieldCadEntIE = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jTextFieldCadEntApelido = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jTextFieldUF = new javax.swing.JFormattedTextField();
        jTextFieldCadEntCep = new javax.swing.JFormattedTextField();
        jTextFieldCadEntCpf = new javax.swing.JFormattedTextField();
        jTextFieldCNPJ = new javax.swing.JFormattedTextField();
        jTextFieldCadEntTelefone = new javax.swing.JFormattedTextField();
        jTextFieldDDD = new javax.swing.JFormattedTextField();
        jTextFieldCadEntRg = new javax.swing.JFormattedTextField();
        jButtonVoltaEntidadeMovimento = new javax.swing.JButton();
        jButtonLimpaEntidadeMovimento = new javax.swing.JButton();
        jDialogListaCheque = new javax.swing.JDialog();
        jButtonAdicionaCheque = new javax.swing.JButton();
        jButtonVoltaCheque = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabelComp = new javax.swing.JLabel();
        jLabelBanco = new javax.swing.JLabel();
        jLabelAgencia = new javax.swing.JLabel();
        jLabelConta = new javax.swing.JLabel();
        jLabelNumCheque = new javax.swing.JLabel();
        jLabelOrigem = new javax.swing.JLabel();
        jLabelDevolvido = new javax.swing.JLabel();
        jComboBoxSituacaoCheque = new javax.swing.JComboBox();
        jTextFieldComp1 = new javax.swing.JTextField();
        jTextFieldBanco1 = new javax.swing.JTextField();
        jTextFieldAgencia1 = new javax.swing.JTextField();
        jTextFieldConta1 = new javax.swing.JTextField();
        jTextFieldNumCheque1 = new javax.swing.JTextField();
        jLabelValor = new javax.swing.JLabel();
        jLabelData = new javax.swing.JLabel();
        jDateChooserChequeCadastro = new com.toedter.calendar.JDateChooser("dd/MM/yyyy", "##/##/#####", '_');
        jTextFieldEmitente = new javax.swing.JTextField();
        jMoneyFieldChequeCadastro = new br.com.GUI.caixa.JMoneyField();
        jButtonEditarCheque = new javax.swing.JButton();
        jButtonExcluiCheque = new javax.swing.JButton();
        jLabelCheque = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jTableChequeCadastro = new javax.swing.JTable();
        jButton_LimparCheque = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jDialogCadBanco = new javax.swing.JDialog();
        jButtonCadastraBanco = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabelAgenciaBanco = new javax.swing.JLabel();
        jTextFieldContaBanco = new javax.swing.JTextField();
        jTextFieldNomeBanco = new javax.swing.JTextField();
        jTextFieldAgenciaBanco = new javax.swing.JTextField();
        jLabelNomeBanco = new javax.swing.JLabel();
        jLabelContaBanco = new javax.swing.JLabel();
        jButtonVoltaCadastraBanco = new javax.swing.JButton();
        jButtonLimparBanco = new javax.swing.JButton();
        jDialogListaBanco = new javax.swing.JDialog();
        jButtonAtualizaBanco = new javax.swing.JButton();
        jLabelPesquisaBanco = new javax.swing.JLabel();
        jButtonOkBanco = new javax.swing.JButton();
        jTextFieldDialogPesquisaBanco = new javax.swing.JTextField();
        jButtonNovoBanco = new javax.swing.JButton();
        jButtonVoltaBanco = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTableBanco = new javax.swing.JTable();
        jButtonAvancaCadBanco = new javax.swing.JButton();
        jButtonVoltaCadBanco = new javax.swing.JButton();
        jDialogEntCheque = new javax.swing.JDialog();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTableEntidadeCheque = new javax.swing.JTable();
        jDialogListaHistorico = new javax.swing.JDialog();
        jButtonAtualizaHistorico = new javax.swing.JButton();
        jLabel46 = new javax.swing.JLabel();
        jButtonOkHistorico = new javax.swing.JButton();
        jButtonVoltaHistorico = new javax.swing.JButton();
        jTextFieldDialogPesquisaHistorico = new javax.swing.JTextField();
        jButtonAvancaHistorico = new javax.swing.JButton();
        jButtonVoltarHistorico = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTableHistorico = new javax.swing.JTable();
        jButtonCadastrarHistorico = new javax.swing.JButton();
        jButtonEditarHistorico = new javax.swing.JButton();
        jLabelHistorico = new javax.swing.JLabel();
        jDialogListaChequePagar = new javax.swing.JDialog();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTableChequePagar = new javax.swing.JTable();
        jButtonOkChequePagar = new javax.swing.JButton();
        jButtonCancelaChequePagar = new javax.swing.JButton();
        jDialogPesquisaAvancada = new javax.swing.JDialog();
        jPanel7 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jRadioButton_Credito1 = new javax.swing.JRadioButton();
        jRadioButton_Debito1 = new javax.swing.JRadioButton();
        jComboBox_Tipo1 = new javax.swing.JComboBox();
        jTextField_Nome1 = new javax.swing.JTextField();
        jDateChooser2 = new com.toedter.calendar.JDateChooser("dd/MM/yyyy", "##/##/#####", '_');
        jButtonTipo1 = new javax.swing.JButton();
        jComboBox_Pagamento1 = new javax.swing.JComboBox();
        jLabel19 = new javax.swing.JLabel();
        jButtonPagamento1 = new javax.swing.JButton();
        jTextField_Codigo1 = new javax.swing.JTextField();
        jTextField_Pagamento1 = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        cBox1 =  new AutoComplete(names);
        jLabel30 = new javax.swing.JLabel();
        jButtonHistorico1 = new javax.swing.JButton();
        jTextField_Nome_Pagamento1 = new javax.swing.JTextField();
        jMoneyField2 = new br.com.GUI.caixa.JMoneyField();
        jComboBox_Caixa1 = new javax.swing.JComboBox();
        jComboBox_Caixa2 = new javax.swing.JComboBox();
        jLabel32 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jDateChooser3 = new com.toedter.calendar.JDateChooser("dd/MM/yyyy", "##/##/#####", '_');
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jDialogNovoCaixa = new javax.swing.JDialog();
        jPanel10 = new javax.swing.JPanel();
        jLabelNome = new javax.swing.JLabel();
        jTextFieldNomeCaixa = new javax.swing.JTextField();
        jLabelRazaoSocial = new javax.swing.JLabel();
        jTextFieldRazaoSocial = new javax.swing.JTextField();
        jLabelCidade = new javax.swing.JLabel();
        jTextFieldCidade = new javax.swing.JTextField();
        jLabelResponsavelLegal = new javax.swing.JLabel();
        jTextFieldResponsavel = new javax.swing.JTextField();
        jTextFieldEndereço = new javax.swing.JTextField();
        jLabelEndereço = new javax.swing.JLabel();
        jLabelRegCivil = new javax.swing.JLabel();
        jTextFieldRegCivil = new javax.swing.JTextField();
        jLabelContador = new javax.swing.JLabel();
        jTextFieldContador = new javax.swing.JTextField();
        jLabelEmpresa = new javax.swing.JLabel();
        jTextFieldEmpresa = new javax.swing.JTextField();
        jButtonVoltar = new javax.swing.JButton();
        jButtonEditar1 = new javax.swing.JButton();
        jButtonAvancar1 = new javax.swing.JButton();
        jButtonRemover = new javax.swing.JButton();
        jButtonCadastrar = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableCaixaNovo = new javax.swing.JTable();
        jLabelCaixa = new javax.swing.JLabel();
        jButtonLimparCaixa = new javax.swing.JButton();
        jButtonSairCaixa = new javax.swing.JButton();
        jDialogConsultaCheque = new javax.swing.JDialog();
        jLabelPesquisar = new javax.swing.JLabel();
        jTextFieldPesquisar = new javax.swing.JTextField();
        jPanel11 = new javax.swing.JPanel();
        jLabelComp1 = new javax.swing.JLabel();
        jLabelBanco1 = new javax.swing.JLabel();
        jLabelAgencia1 = new javax.swing.JLabel();
        jLabelConta1 = new javax.swing.JLabel();
        jLabelNumCheque1 = new javax.swing.JLabel();
        jLabelOrigem1 = new javax.swing.JLabel();
        jLabelDevolvido1 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jTextFieldComp = new javax.swing.JTextField();
        jTextFieldBanco = new javax.swing.JTextField();
        jTextFieldAgencia = new javax.swing.JTextField();
        jTextFieldConta = new javax.swing.JTextField();
        jTextFieldNumCheque = new javax.swing.JTextField();
        jTextFieldEmitentePesquisa = new javax.swing.JTextField();
        jLabelValor1 = new javax.swing.JLabel();
        jLabelData1 = new javax.swing.JLabel();
        jDatePreInicial = new com.toedter.calendar.JDateChooser();
        jMoneyFieldChequePesquisa = new br.com.GUI.caixa.JMoneyField();
        jDatePreFinal = new com.toedter.calendar.JDateChooser();
        jLabelData2 = new javax.swing.JLabel();
        jDateEntradaFinal = new com.toedter.calendar.JDateChooser();
        jDateEntradaInicial = new com.toedter.calendar.JDateChooser();
        jLabelOrigem2 = new javax.swing.JLabel();
        jLabelOrigem3 = new javax.swing.JLabel();
        jLabelOrigem4 = new javax.swing.JLabel();
        jDateSaidaInicial = new com.toedter.calendar.JDateChooser();
        jLabelOrigem5 = new javax.swing.JLabel();
        jDateSaidaFinal = new com.toedter.calendar.JDateChooser();
        jLabelComp2 = new javax.swing.JLabel();
        jTextFieldCodigoCheque = new javax.swing.JTextField();
        jScrollPane10 = new javax.swing.JScrollPane();
        jTableConsultaCheque = new javax.swing.JTable();
        jLabelCheque1 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jPanel12 = new javax.swing.JPanel();
        jButtonVoltar1 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButtonAvancar2 = new javax.swing.JButton();
        jButtonPesquisaAvancadaCheque = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jComboBox_Caixa = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jTextField_Saldo = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jRadioButton_Credito = new javax.swing.JRadioButton();
        jRadioButton_Debito = new javax.swing.JRadioButton();
        jComboBox_Tipo = new javax.swing.JComboBox();
        jDateChooser1 = new com.toedter.calendar.JDateChooser("dd/MM/yyyy", "##/##/#####", '_');
        jButtonTipo = new javax.swing.JButton();
        jComboBox_Pagamento = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jButtonPagamento = new javax.swing.JButton();
        jTextField_CodigoMov = new javax.swing.JTextField();
        jTextField_Pagamento = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        cBox =  new AutoComplete(names);
        jLabel15 = new javax.swing.JLabel();
        jButtonHistorico = new javax.swing.JButton();
        jTextField_Nome_Pagamento = new javax.swing.JTextField();
        jMoneyFieldValor = new br.com.GUI.caixa.JMoneyField();
        jTextField_NomeMov = new javax.swing.JTextField();
        jButton_Lancar = new javax.swing.JButton();
        jButton_Cancelar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTableChequesMovimento = new javax.swing.JTable();
        jButton_LimparMov = new javax.swing.JButton();
        Lancamento = new javax.swing.JLabel();
        jButtonNovoLancamento = new javax.swing.JButton();
        jButtonPesquisaAvancada = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jButton_Deletar = new javax.swing.JButton();
        jButtonAvancar = new javax.swing.JButton();
        jButtonEditar = new javax.swing.JButton();
        jButtonAtualizar = new javax.swing.JButton();
        jButtonVolta = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTextField_Pesquisa = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        jButton_Deletar1 = new javax.swing.JButton();
        jButtonEditarCheques = new javax.swing.JButton();

        jDialogListaEntidade.setTitle("Cliente Fornecedor");
        jDialogListaEntidade.setMinimumSize(new java.awt.Dimension(850, 335));
        jDialogListaEntidade.setModalityType(java.awt.Dialog.ModalityType.TOOLKIT_MODAL);
        jDialogListaEntidade.setName("Cliente Fornecedor"); // NOI18N
        jDialogListaEntidade.setResizable(false);
        jDialogListaEntidade.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jTextFieldPesquisaEntidadeDialog.setDocument(new LetraMaiuscula());
        jTextFieldPesquisaEntidadeDialog.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldPesquisaEntidadeDialogActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jTextFieldPesquisaEntidadeDialog, new org.netbeans.lib.awtextra.AbsoluteConstraints(97, 11, 315, -1));

        jButtonOkEntidade.setText("ok");
        jButtonOkEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOkEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonOkEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 270, 73, -1));

        jLabelPesquisaEntidadeDialog.setText("Pesquisa:");
        jDialogListaEntidade.getContentPane().add(jLabelPesquisaEntidadeDialog, new org.netbeans.lib.awtextra.AbsoluteConstraints(33, 14, -1, -1));

        jButtonAtualizaEntidade.setText("Atualizar");
        jButtonAtualizaEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAtualizaEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonAtualizaEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 270, 109, -1));

        jButtonVoltarEntidade.setText("Voltar");
        jButtonVoltarEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltarEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonVoltarEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 270, 87, -1));

        jButtonNovoEntidade.setText("Novo");
        jButtonNovoEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNovoEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonNovoEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 270, 83, -1));

        jTableEntidade.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Nome", "Endereço", "Telefone", "Bairro", "Limite", "Obs."
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableEntidade.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableEntidadeMouseClicked(evt);
            }
        });
        jScrollPane7.setViewportView(jTableEntidade);

        jDialogListaEntidade.getContentPane().add(jScrollPane7, new org.netbeans.lib.awtextra.AbsoluteConstraints(14, 44, 820, 197));

        jButtonProximoEntidade.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonProximoEntidade.setContentAreaFilled(false);
        jButtonProximoEntidade.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonProximoEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonProximoEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonProximoEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 250, -1, 20));

        jButtonAnteriorEntidade.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonAnteriorEntidade.setContentAreaFilled(false);
        jButtonAnteriorEntidade.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonAnteriorEntidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAnteriorEntidadeActionPerformed(evt);
            }
        });
        jDialogListaEntidade.getContentPane().add(jButtonAnteriorEntidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 250, -1, 20));

        jDialogCadEntidade.setMinimumSize(new java.awt.Dimension(598, 370));
        jDialogCadEntidade.setModalityType(java.awt.Dialog.ModalityType.TOOLKIT_MODAL);
        jDialogCadEntidade.setResizable(false);
        jDialogCadEntidade.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButtonCadastrarEntidadeMovimento.setText("Cadastrar");
        jButtonCadastrarEntidadeMovimento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCadastrarEntidadeMovimentoActionPerformed(evt);
            }
        });
        jDialogCadEntidade.getContentPane().add(jButtonCadastrarEntidadeMovimento, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 292, 93, -1));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados Completo do Cliente/Fornecedor"));

        jLabel20.setText("Nome:");

        jLabel21.setText("Endereço:");

        jLabel22.setText("Bairro:");

        jLabel23.setText("Cidade:");

        jLabel24.setText("CEP:");

        jLabel25.setText("Telefone:");

        jLabel26.setText("CPF:");

        jLabel27.setText("RG:");

        jLabel29.setText("Obs.:");

        jTextFieldCadEntNome.setDocument(new LetraMaiuscula());

        jTextFieldCadEntEndereco.setDocument(new LetraMaiuscula());

        jTextFieldCadEntBairro.setDocument(new LetraMaiuscula());

        jTextFieldCadEntCidade.setDocument(new LetraMaiuscula());

        jTextFieldCadEntObs.setDocument(new LetraMaiuscula());
        jTextFieldCadEntObs.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        jLabel33.setText("CNPJ:");

        jLabel34.setText("IE:");

        jTextFieldCadEntApelido.setDocument(new LetraMaiuscula());

        jLabel35.setText("Apelido:");

        jLabel36.setText("DDD:");

        jLabel37.setText("UF:");

        try {
            Uf = new MaskFormatter("UU");
            jTextFieldUF = new JFormattedTextField(Uf);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldUF.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldUFFocusLost(evt);
            }
        });

        try {
            cp = new MaskFormatter("#####-###");
            jTextFieldCadEntCep = new JFormattedTextField(cp);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldCadEntCep.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCadEntCepActionPerformed(evt);
            }
        });
        jTextFieldCadEntCep.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCadEntCepFocusLost(evt);
            }
        });

        try {
            Cpf = new MaskFormatter("###.###.###-##");
            jTextFieldCadEntCpf = new JFormattedTextField(Cpf);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldCadEntCpf.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCadEntCpfFocusLost(evt);
            }
        });

        try {
            CNPJ = new MaskFormatter("###.###.###/####-##");
            jTextFieldCNPJ = new JFormattedTextField(CNPJ);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldCNPJ.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCNPJFocusLost(evt);
            }
        });

        try {
            Tel = new MaskFormatter("####-####");
            jTextFieldCadEntTelefone = new JFormattedTextField(Tel);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldCadEntTelefone.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCadEntTelefoneFocusLost(evt);
            }
        });

        try {
            DDD = new MaskFormatter("(##)");
            jTextFieldDDD = new JFormattedTextField(DDD);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldDDD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldDDDActionPerformed(evt);
            }
        });
        jTextFieldDDD.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldDDDFocusLost(evt);
            }
        });

        try {
            Rg = new MaskFormatter("##.###.###-#");
            jTextFieldCadEntRg = new JFormattedTextField(Rg);
        } catch (ParseException ex) {
            Logger.getLogger(FrameEntidade.class.getName()).log(Level.SEVERE, null, ex);
        }
        jTextFieldCadEntRg.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextFieldCadEntRgFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addComponent(jLabel23)
                            .addComponent(jLabel34)
                            .addComponent(jLabel35)
                            .addComponent(jLabel36))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jTextFieldCadEntEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 263, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(10, 10, 10)
                                        .addComponent(jLabel24)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldCadEntCep))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel22)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldCadEntBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jTextFieldDDD, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel25))
                                    .addComponent(jTextFieldCadEntCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextFieldCadEntTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(16, 16, 16)
                                        .addComponent(jLabel37)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextFieldUF, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jTextFieldCadEntRg)
                                    .addComponent(jTextFieldCadEntIE, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel33, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel26, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextFieldCadEntCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTextFieldCNPJ, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jTextFieldCadEntApelido)))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addGap(38, 38, 38)
                        .addComponent(jTextFieldCadEntObs, javax.swing.GroupLayout.PREFERRED_SIZE, 439, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel27)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel20)
                        .addGap(33, 33, 33)
                        .addComponent(jTextFieldCadEntNome, javax.swing.GroupLayout.PREFERRED_SIZE, 448, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(jTextFieldCadEntNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldCadEntApelido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jTextFieldCadEntEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jTextFieldCadEntBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(4, 4, 4)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(jTextFieldCadEntCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel37)
                    .addComponent(jTextFieldUF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(jTextFieldCadEntCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(jLabel25)
                    .addComponent(jTextFieldDDD, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldCadEntTelefone))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(jLabel26)
                    .addComponent(jTextFieldCadEntRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldCadEntCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(4, 4, 4)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel34)
                    .addComponent(jTextFieldCadEntIE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldCNPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldCadEntObs, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)))
        );

        jDialogCadEntidade.getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 11, -1, -1));

        jButtonVoltaEntidadeMovimento.setText("Voltar");
        jButtonVoltaEntidadeMovimento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaEntidadeMovimentoActionPerformed(evt);
            }
        });
        jDialogCadEntidade.getContentPane().add(jButtonVoltaEntidadeMovimento, new org.netbeans.lib.awtextra.AbsoluteConstraints(471, 292, 71, -1));

        jButtonLimpaEntidadeMovimento.setText("Limpar");
        jButtonLimpaEntidadeMovimento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLimpaEntidadeMovimentoActionPerformed(evt);
            }
        });
        jDialogCadEntidade.getContentPane().add(jButtonLimpaEntidadeMovimento, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 292, -1, -1));

        jDialogListaCheque.setMinimumSize(new java.awt.Dimension(650, 470));
        jDialogListaCheque.setModal(true);
        jDialogListaCheque.setResizable(false);
        jDialogListaCheque.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButtonAdicionaCheque.setText("Adicionar");
        jButtonAdicionaCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAdicionaChequeActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButtonAdicionaCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 170, 90, 20));

        jButtonVoltaCheque.setText("Ok");
        jButtonVoltaCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaChequeActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButtonVoltaCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(540, 380, 87, -1));

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados do Cheque"));
        jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabelComp.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelComp.setText("*Comp:");
        jPanel6.add(jLabelComp, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 34, -1, -1));

        jLabelBanco.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelBanco.setText("*Banco:");
        jPanel6.add(jLabelBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(197, 34, -1, -1));

        jLabelAgencia.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelAgencia.setText("*Agência:");
        jPanel6.add(jLabelAgencia, new org.netbeans.lib.awtextra.AbsoluteConstraints(393, 34, -1, -1));

        jLabelConta.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelConta.setText("*Conta:");
        jPanel6.add(jLabelConta, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 60, -1, -1));

        jLabelNumCheque.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelNumCheque.setText("*Cheque Nº:");
        jPanel6.add(jLabelNumCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(197, 60, -1, -1));

        jLabelOrigem.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem.setText("*Emitente:");
        jPanel6.add(jLabelOrigem, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 117, -1, -1));

        jLabelDevolvido.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelDevolvido.setText("*Devolvido:");
        jPanel6.add(jLabelDevolvido, new org.netbeans.lib.awtextra.AbsoluteConstraints(395, 60, -1, -1));

        jComboBoxSituacaoCheque.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Não", "Sim" }));
        jPanel6.add(jComboBoxSituacaoCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(471, 57, 121, -1));

        jTextFieldComp1.setDocument(new LetraMaiuscula());
        jTextFieldComp1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldComp1ActionPerformed(evt);
            }
        });
        jPanel6.add(jTextFieldComp1, new org.netbeans.lib.awtextra.AbsoluteConstraints(88, 31, 91, -1));

        jTextFieldBanco1.setDocument(new LetraMaiuscula());
        jPanel6.add(jTextFieldBanco1, new org.netbeans.lib.awtextra.AbsoluteConstraints(269, 31, 106, -1));
        jPanel6.add(jTextFieldAgencia1, new org.netbeans.lib.awtextra.AbsoluteConstraints(471, 31, 121, -1));
        jPanel6.add(jTextFieldConta1, new org.netbeans.lib.awtextra.AbsoluteConstraints(88, 57, 91, -1));
        jPanel6.add(jTextFieldNumCheque1, new org.netbeans.lib.awtextra.AbsoluteConstraints(269, 57, 108, -1));

        jLabelValor.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelValor.setText("*Valor:");
        jPanel6.add(jLabelValor, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 86, -1, -1));

        jLabelData.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelData.setText("*Data:");
        jPanel6.add(jLabelData, new org.netbeans.lib.awtextra.AbsoluteConstraints(197, 89, -1, -1));
        jPanel6.add(jDateChooserChequeCadastro, new org.netbeans.lib.awtextra.AbsoluteConstraints(269, 83, 108, -1));

        jTextFieldEmitente.setDocument(new LetraMaiuscula());
        jPanel6.add(jTextFieldEmitente, new org.netbeans.lib.awtextra.AbsoluteConstraints(87, 114, 510, -1));
        jPanel6.add(jMoneyFieldChequeCadastro, new org.netbeans.lib.awtextra.AbsoluteConstraints(88, 83, 91, -1));

        jDialogListaCheque.getContentPane().add(jPanel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 620, 150));

        jButtonEditarCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png"))); // NOI18N
        jButtonEditarCheque.setContentAreaFilled(false);
        jButtonEditarCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png"))); // NOI18N
        jButtonEditarCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditarChequeActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButtonEditarCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 170, 30, 20));

        jButtonExcluiCheque.setBackground(null);
        jButtonExcluiCheque.setForeground(null);
        jButtonExcluiCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5].png"))); // NOI18N
        jButtonExcluiCheque.setBorderPainted(false);
        jButtonExcluiCheque.setContentAreaFilled(false);
        jButtonExcluiCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5]over.png"))); // NOI18N
        jButtonExcluiCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonExcluiChequeActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButtonExcluiCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 170, 40, 20));

        jLabelCheque.setText("Cheque");
        jDialogListaCheque.getContentPane().add(jLabelCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 170, -1, -1));

        jTableChequeCadastro.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Agência", "Conta", "Cheque Nº", "Banco", "Emitente", "Data", "Devolvido", "Valor", "Comp"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, true, false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableChequeCadastro.getTableHeader().setReorderingAllowed(false);
        jScrollPane9.setViewportView(jTableChequeCadastro);
        jTableChequeCadastro.getColumnModel().getColumn(0).setMinWidth(50);
        jTableChequeCadastro.getColumnModel().getColumn(0).setPreferredWidth(50);
        jTableChequeCadastro.getColumnModel().getColumn(0).setMaxWidth(50);
        jTableChequeCadastro.getColumnModel().getColumn(1).setMinWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(1).setPreferredWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(1).setMaxWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(2).setMinWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(2).setPreferredWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(2).setMaxWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(3).setMinWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(3).setPreferredWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(3).setMaxWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(4).setMinWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(4).setPreferredWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(4).setMaxWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(5).setMinWidth(110);
        jTableChequeCadastro.getColumnModel().getColumn(5).setPreferredWidth(110);
        jTableChequeCadastro.getColumnModel().getColumn(5).setMaxWidth(110);
        jTableChequeCadastro.getColumnModel().getColumn(6).setMinWidth(80);
        jTableChequeCadastro.getColumnModel().getColumn(6).setPreferredWidth(80);
        jTableChequeCadastro.getColumnModel().getColumn(6).setMaxWidth(80);
        jTableChequeCadastro.getColumnModel().getColumn(7).setMinWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(7).setPreferredWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(7).setMaxWidth(70);
        jTableChequeCadastro.getColumnModel().getColumn(8).setMinWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(8).setPreferredWidth(100);
        jTableChequeCadastro.getColumnModel().getColumn(8).setMaxWidth(100);

        jDialogListaCheque.getContentPane().add(jScrollPane9, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, 620, 170));

        jButton_LimparCheque.setText("Limpar");
        jButton_LimparCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_LimparChequeActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButton_LimparCheque, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 380, -1, -1));

        jButton2.setText("Consulta Cheques");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jDialogListaCheque.getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 170, -1, 20));

        jDialogCadBanco.setMinimumSize(new java.awt.Dimension(300, 230));
        jDialogCadBanco.setModal(true);
        jDialogCadBanco.setResizable(false);

        jButtonCadastraBanco.setText("Cadastrar");
        jButtonCadastraBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCadastraBancoActionPerformed(evt);
            }
        });

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Cadastro de Bancos"));

        jLabelAgenciaBanco.setText("Agência");

        jTextFieldNomeBanco.setDocument(new LetraMaiuscula());

        jTextFieldAgenciaBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldAgenciaBancoActionPerformed(evt);
            }
        });

        jLabelNomeBanco.setText("Nome");

        jLabelContaBanco.setText("Conta");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabelNomeBanco)
                        .addGap(6, 6, 6)
                        .addComponent(jTextFieldNomeBanco, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelAgenciaBanco)
                            .addComponent(jLabelContaBanco))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldContaBanco, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                            .addComponent(jTextFieldAgenciaBanco, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNomeBanco)
                    .addComponent(jTextFieldNomeBanco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldAgenciaBanco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelAgenciaBanco))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldContaBanco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelContaBanco))
                .addGap(60, 60, 60))
        );

        jButtonVoltaCadastraBanco.setText("Voltar");
        jButtonVoltaCadastraBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaCadastraBancoActionPerformed(evt);
            }
        });

        jButtonLimparBanco.setText("Limpar");
        jButtonLimparBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLimparBancoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialogCadBancoLayout = new javax.swing.GroupLayout(jDialogCadBanco.getContentPane());
        jDialogCadBanco.getContentPane().setLayout(jDialogCadBancoLayout);
        jDialogCadBancoLayout.setHorizontalGroup(
            jDialogCadBancoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogCadBancoLayout.createSequentialGroup()
                .addGroup(jDialogCadBancoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jDialogCadBancoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jDialogCadBancoLayout.createSequentialGroup()
                        .addGap(13, 13, 13)
                        .addComponent(jButtonLimparBanco)
                        .addGap(35, 35, 35)
                        .addComponent(jButtonCadastraBanco)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
                        .addComponent(jButtonVoltaCadastraBanco, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jDialogCadBancoLayout.setVerticalGroup(
            jDialogCadBancoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogCadBancoLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jDialogCadBancoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonCadastraBanco)
                    .addComponent(jButtonVoltaCadastraBanco)
                    .addComponent(jButtonLimparBanco))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jDialogListaBanco.setMinimumSize(new java.awt.Dimension(600, 325));
        jDialogListaBanco.setModal(true);
        jDialogListaBanco.setResizable(false);
        jDialogListaBanco.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButtonAtualizaBanco.setText("Atualizar");
        jButtonAtualizaBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAtualizaBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonAtualizaBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 270, 95, -1));

        jLabelPesquisaBanco.setText("Pesquisa:");
        jDialogListaBanco.getContentPane().add(jLabelPesquisaBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 14, -1, -1));

        jButtonOkBanco.setText("ok");
        jButtonOkBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOkBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonOkBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 270, 99, -1));

        jTextFieldDialogPesquisaBanco.setDocument(new LetraMaiuscula());
        jTextFieldDialogPesquisaBanco.setEditable(false);
        jDialogListaBanco.getContentPane().add(jTextFieldDialogPesquisaBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(74, 11, 491, -1));

        jButtonNovoBanco.setText("Novo");
        jButtonNovoBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNovoBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonNovoBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 270, 83, -1));

        jButtonVoltaBanco.setText("Voltar");
        jButtonVoltaBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonVoltaBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 270, 87, -1));

        jTableBanco.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Banco", "Agencia", "Conta"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableBanco.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableBancoMouseClicked(evt);
            }
        });
        jScrollPane4.setViewportView(jTableBanco);
        jTableBanco.getColumnModel().getColumn(0).setMinWidth(70);
        jTableBanco.getColumnModel().getColumn(0).setPreferredWidth(70);
        jTableBanco.getColumnModel().getColumn(0).setMaxWidth(70);
        jTableBanco.getColumnModel().getColumn(1).setMinWidth(300);
        jTableBanco.getColumnModel().getColumn(1).setPreferredWidth(300);
        jTableBanco.getColumnModel().getColumn(1).setMaxWidth(300);
        jTableBanco.getColumnModel().getColumn(2).setMinWidth(100);
        jTableBanco.getColumnModel().getColumn(2).setPreferredWidth(100);
        jTableBanco.getColumnModel().getColumn(2).setMaxWidth(100);
        jTableBanco.getColumnModel().getColumn(3).setMinWidth(100);
        jTableBanco.getColumnModel().getColumn(3).setPreferredWidth(100);
        jTableBanco.getColumnModel().getColumn(3).setMaxWidth(100);

        jDialogListaBanco.getContentPane().add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 37, 570, 190));

        jButtonAvancaCadBanco.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonAvancaCadBanco.setContentAreaFilled(false);
        jButtonAvancaCadBanco.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonAvancaCadBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAvancaCadBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonAvancaCadBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 230, 25, -1));

        jButtonVoltaCadBanco.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonVoltaCadBanco.setContentAreaFilled(false);
        jButtonVoltaCadBanco.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonVoltaCadBanco.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaCadBancoActionPerformed(evt);
            }
        });
        jDialogListaBanco.getContentPane().add(jButtonVoltaCadBanco, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 230, 25, -1));

        jDialogEntCheque.setMinimumSize(new java.awt.Dimension(850, 245));
        jDialogEntCheque.setModal(true);
        jDialogEntCheque.setResizable(false);

        jTableEntidadeCheque.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Nome", "Endereço", "Telefone", "Bairro", "Limite", "Obs."
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableEntidadeCheque.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableEntidadeChequeMouseClicked(evt);
            }
        });
        jScrollPane6.setViewportView(jTableEntidadeCheque);

        javax.swing.GroupLayout jDialogEntChequeLayout = new javax.swing.GroupLayout(jDialogEntCheque.getContentPane());
        jDialogEntCheque.getContentPane().setLayout(jDialogEntChequeLayout);
        jDialogEntChequeLayout.setHorizontalGroup(
            jDialogEntChequeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogEntChequeLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 822, Short.MAX_VALUE)
                .addContainerGap())
        );
        jDialogEntChequeLayout.setVerticalGroup(
            jDialogEntChequeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogEntChequeLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jDialogListaHistorico.setMinimumSize(new java.awt.Dimension(680, 390));
        jDialogListaHistorico.setModal(true);
        jDialogListaHistorico.setResizable(false);

        jButtonAtualizaHistorico.setText("Atualizar");
        jButtonAtualizaHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAtualizaHistoricoActionPerformed(evt);
            }
        });

        jLabel46.setText("Pesquisa:");

        jButtonOkHistorico.setText("ok");
        jButtonOkHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOkHistoricoActionPerformed(evt);
            }
        });

        jButtonVoltaHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonVoltaHistorico.setContentAreaFilled(false);
        jButtonVoltaHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonVoltaHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaHistoricoActionPerformed(evt);
            }
        });

        jTextFieldDialogPesquisaHistorico.setDocument(new LetraMaiuscula());
        jTextFieldDialogPesquisaHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldDialogPesquisaHistoricoActionPerformed(evt);
            }
        });

        jButtonAvancaHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonAvancaHistorico.setContentAreaFilled(false);
        jButtonAvancaHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonAvancaHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAvancaHistoricoActionPerformed(evt);
            }
        });

        jButtonVoltarHistorico.setText("Voltar");
        jButtonVoltarHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltarHistoricoActionPerformed(evt);
            }
        });

        jTableHistorico.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Histórico Padrão"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableHistorico.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableHistoricoMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(jTableHistorico);
        jTableHistorico.getColumnModel().getColumn(0).setMinWidth(100);
        jTableHistorico.getColumnModel().getColumn(0).setPreferredWidth(100);
        jTableHistorico.getColumnModel().getColumn(0).setMaxWidth(100);

        jButtonCadastrarHistorico.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButtonCadastrarHistorico.setText("Cadastrar");
        jButtonCadastrarHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCadastrarHistoricoActionPerformed(evt);
            }
        });

        jButtonEditarHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png"))); // NOI18N
        jButtonEditarHistorico.setBorder(null);
        jButtonEditarHistorico.setContentAreaFilled(false);
        jButtonEditarHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png"))); // NOI18N
        jButtonEditarHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditarHistoricoActionPerformed(evt);
            }
        });

        jLabelHistorico.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabelHistorico.setText("Historico");

        javax.swing.GroupLayout jDialogListaHistoricoLayout = new javax.swing.GroupLayout(jDialogListaHistorico.getContentPane());
        jDialogListaHistorico.getContentPane().setLayout(jDialogListaHistoricoLayout);
        jDialogListaHistoricoLayout.setHorizontalGroup(
            jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogListaHistoricoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane3)
                    .addGroup(jDialogListaHistoricoLayout.createSequentialGroup()
                        .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButtonOkHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelHistorico))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(jDialogListaHistoricoLayout.createSequentialGroup()
                                .addComponent(jButtonVoltaHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jButtonEditarHistorico)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonAvancaHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jButtonAtualizaHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(190, 190, 190)
                        .addComponent(jButtonVoltarHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jDialogListaHistoricoLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jLabel46)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextFieldDialogPesquisaHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 315, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonCadastrarHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 146, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jDialogListaHistoricoLayout.setVerticalGroup(
            jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogListaHistoricoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel46)
                    .addComponent(jTextFieldDialogPesquisaHistorico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButtonCadastrarHistorico))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jButtonVoltaHistorico)
                        .addComponent(jButtonAvancaHistorico)
                        .addComponent(jButtonEditarHistorico))
                    .addComponent(jLabelHistorico))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jDialogListaHistoricoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAtualizaHistorico)
                    .addComponent(jButtonOkHistorico)
                    .addComponent(jButtonVoltarHistorico))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jDialogListaChequePagar.setMinimumSize(new java.awt.Dimension(850, 460));
        jDialogListaChequePagar.setModal(true);
        jDialogListaChequePagar.setResizable(false);

        jTableChequePagar.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Agência", "Conta", "Cheque Nº", "Banco", "Emitente", "Devolvido", "Valor", "Pagar"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableChequePagar.setColumnSelectionAllowed(true);
        jTableChequePagar.getTableHeader().setReorderingAllowed(false);
        jTableChequePagar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTableChequePagarMouseClicked(evt);
            }
        });
        jTableChequePagar.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jTableChequePagarPropertyChange(evt);
            }
        });
        jScrollPane8.setViewportView(jTableChequePagar);
        jTableChequePagar.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jTableChequePagar.getColumnModel().getColumn(0).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(0).setPreferredWidth(70);
        jTableChequePagar.getColumnModel().getColumn(1).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(1).setPreferredWidth(100);
        jTableChequePagar.getColumnModel().getColumn(2).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(2).setPreferredWidth(130);
        jTableChequePagar.getColumnModel().getColumn(3).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(3).setPreferredWidth(160);
        jTableChequePagar.getColumnModel().getColumn(4).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(5).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(5).setPreferredWidth(70);
        jTableChequePagar.getColumnModel().getColumn(6).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(6).setPreferredWidth(80);
        jTableChequePagar.getColumnModel().getColumn(7).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(7).setPreferredWidth(100);
        jTableChequePagar.getColumnModel().getColumn(8).setResizable(false);
        jTableChequePagar.getColumnModel().getColumn(8).setPreferredWidth(50);

        jButtonOkChequePagar.setText("Ok");
        jButtonOkChequePagar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOkChequePagarActionPerformed(evt);
            }
        });

        jButtonCancelaChequePagar.setText("Cancelar");
        jButtonCancelaChequePagar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCancelaChequePagarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialogListaChequePagarLayout = new javax.swing.GroupLayout(jDialogListaChequePagar.getContentPane());
        jDialogListaChequePagar.getContentPane().setLayout(jDialogListaChequePagarLayout);
        jDialogListaChequePagarLayout.setHorizontalGroup(
            jDialogListaChequePagarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogListaChequePagarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialogListaChequePagarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jDialogListaChequePagarLayout.createSequentialGroup()
                        .addComponent(jButtonOkChequePagar, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButtonCancelaChequePagar)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jDialogListaChequePagarLayout.setVerticalGroup(
            jDialogListaChequePagarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogListaChequePagarLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jDialogListaChequePagarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonOkChequePagar)
                    .addComponent(jButtonCancelaChequePagar))
                .addContainerGap())
        );

        jDialogPesquisaAvancada.setMinimumSize(new java.awt.Dimension(645, 375));

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Pesquisa Movimento"));

        jLabel7.setText("Data:");

        jLabel16.setText("Histórico:");

        jLabel17.setText("Tipo:");

        jLabel18.setText("Valor:");

        jRadioButton_Credito1.setText("Credito");

        jRadioButton_Debito1.setText("Debito");

        jComboBox_Tipo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_Tipo1ActionPerformed(evt);
            }
        });

        jTextField_Nome1.setEditable(false);
        jTextField_Nome1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_Nome1ActionPerformed(evt);
            }
        });

        jButtonTipo1.setText(">");
        jButtonTipo1.setToolTipText("Cadastro");
        jButtonTipo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTipo1ActionPerformed(evt);
            }
        });

        jComboBox_Pagamento1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cheque", "Banco", "Dinheiro" }));
        jComboBox_Pagamento1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_Pagamento1ActionPerformed(evt);
            }
        });

        jLabel19.setText("Pagamento:");

        jButtonPagamento1.setText(">");
        jButtonPagamento1.setToolTipText("Cadastro");
        jButtonPagamento1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPagamento1ActionPerformed(evt);
            }
        });

        jTextField_Codigo1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_Codigo1ActionPerformed(evt);
            }
        });
        jTextField_Codigo1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextField_Codigo1FocusLost(evt);
            }
        });

        jTextField_Pagamento1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextField_Pagamento1FocusLost(evt);
            }
        });

        jLabel28.setText("Nome:");

        cBox1.setEditable(true);
        cBox1.setSelectedItem("Oi");
        cBox1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cBox1MouseClicked(evt);
            }
        });
        cBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cBox1ActionPerformed(evt);
            }
        });
        cBox1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                cBox1KeyReleased(evt);
            }
        });

        jLabel30.setText("Codigo:");

        jButtonHistorico1.setText(">");
        jButtonHistorico1.setToolTipText("Cadastro");
        jButtonHistorico1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonHistorico1ActionPerformed(evt);
            }
        });

        jMoneyField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMoneyField2ActionPerformed(evt);
            }
        });

        jComboBox_Caixa1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa1MouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa1MousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa1MouseReleased(evt);
            }
        });
        jComboBox_Caixa1.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBox_Caixa1ItemStateChanged(evt);
            }
        });
        jComboBox_Caixa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_Caixa1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel16)
                    .addComponent(jLabel17)
                    .addComponent(jLabel28)
                    .addComponent(jLabel19)
                    .addComponent(jLabel18))
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jComboBox_Caixa1, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(cBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(jButtonHistorico1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(jComboBox_Tipo1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel30)
                                .addGap(18, 18, 18)
                                .addComponent(jTextField_Codigo1, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(jButtonTipo1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jTextField_Nome1, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addComponent(jComboBox_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jTextField_Nome_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(jTextField_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)
                                .addComponent(jButtonPagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addComponent(jMoneyField2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(22, 22, 22)
                                .addComponent(jRadioButton_Credito1)
                                .addGap(17, 17, 17)
                                .addComponent(jRadioButton_Debito1)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(6, 6, 6)
                                .addComponent(jLabel7))
                            .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jComboBox_Caixa1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel16))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(cBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButtonHistorico1))
                .addGap(6, 6, 6)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel17))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jComboBox_Tipo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel30))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jTextField_Codigo1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButtonTipo1))
                .addGap(6, 6, 6)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel28))
                    .addComponent(jTextField_Nome1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel19))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jComboBox_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jTextField_Nome_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jTextField_Pagamento1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButtonPagamento1))
                .addGap(5, 5, 5)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addComponent(jLabel18))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jMoneyField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jRadioButton_Credito1)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jRadioButton_Debito1))))
        );

        jComboBox_Caixa2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa2MouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa2MousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jComboBox_Caixa2MouseReleased(evt);
            }
        });
        jComboBox_Caixa2.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBox_Caixa2ItemStateChanged(evt);
            }
        });
        jComboBox_Caixa2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_Caixa2ActionPerformed(evt);
            }
        });

        jLabel32.setText("Caixa:");

        jButton1.setText("Voltar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel38.setText("Data Lancamento:");

        jLabel39.setText("Nome do Usuario:");

        javax.swing.GroupLayout jDialogPesquisaAvancadaLayout = new javax.swing.GroupLayout(jDialogPesquisaAvancada.getContentPane());
        jDialogPesquisaAvancada.getContentPane().setLayout(jDialogPesquisaAvancadaLayout);
        jDialogPesquisaAvancadaLayout.setHorizontalGroup(
            jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogPesquisaAvancadaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton1)
                    .addGroup(jDialogPesquisaAvancadaLayout.createSequentialGroup()
                        .addGroup(jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel38)
                            .addComponent(jLabel32))
                        .addGap(18, 18, 18)
                        .addGroup(jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jDialogPesquisaAvancadaLayout.createSequentialGroup()
                                .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel39)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jComboBox_Caixa2, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jDialogPesquisaAvancadaLayout.setVerticalGroup(
            jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialogPesquisaAvancadaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jComboBox_Caixa2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addGroup(jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel38)
                    .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialogPesquisaAvancadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel39)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1)
                .addGap(28, 28, 28))
        );

        jDialogNovoCaixa.setMinimumSize(new java.awt.Dimension(780, 400));

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabelNome.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelNome.setText("*Nome:");

        jTextFieldNomeCaixa.setDocument(new LetraMaiuscula());

        jLabelRazaoSocial.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelRazaoSocial.setText("Razão Social: ");

        jTextFieldRazaoSocial.setDocument(new LetraMaiuscula());
        jTextFieldRazaoSocial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldRazaoSocialActionPerformed(evt);
            }
        });

        jLabelCidade.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelCidade.setText("Cidade:");

        jTextFieldCidade.setDocument(new LetraMaiuscula());

        jLabelResponsavelLegal.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelResponsavelLegal.setText("Responsavel Legal:");

        jTextFieldResponsavel.setDocument(new LetraMaiuscula());

        jTextFieldEndereço.setDocument(new LetraMaiuscula());

        jLabelEndereço.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelEndereço.setText("Endereço:");

        jLabelRegCivil.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelRegCivil.setText("Registro Civil:");

        jTextFieldRegCivil.setDocument(new LetraMaiuscula());

        jLabelContador.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelContador.setText("Contador: ");

        jTextFieldContador.setDocument(new LetraMaiuscula());

        jLabelEmpresa.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelEmpresa.setText("Nome da Empresa:");

        jTextFieldEmpresa.setDocument(new LetraMaiuscula());

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelEndereço)
                            .addComponent(jLabelRegCivil)
                            .addComponent(jLabelRazaoSocial)))
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGap(45, 45, 45)
                        .addComponent(jLabelNome, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldRegCivil)
                    .addComponent(jTextFieldEndereço)
                    .addComponent(jTextFieldRazaoSocial)
                    .addComponent(jTextFieldNomeCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addComponent(jLabelEmpresa)
                                .addGap(19, 19, 19))
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addComponent(jLabelContador)
                                .addGap(18, 18, 18)))
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextFieldEmpresa, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                            .addComponent(jTextFieldContador)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabelResponsavelLegal)
                            .addComponent(jLabelCidade))
                        .addGap(15, 15, 15)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextFieldCidade, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE)
                            .addComponent(jTextFieldResponsavel))))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelCidade))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabelResponsavelLegal)
                            .addComponent(jTextFieldResponsavel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGap(26, 26, 26)
                                .addComponent(jTextFieldContador, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel10Layout.createSequentialGroup()
                                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabelEmpresa)
                                    .addComponent(jTextFieldEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabelContador))))
                    .addGroup(jPanel10Layout.createSequentialGroup()
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldNomeCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelNome, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldRazaoSocial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelRazaoSocial))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldEndereço, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelEndereço))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextFieldRegCivil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelRegCivil))))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        jButtonVoltar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonVoltar.setContentAreaFilled(false);
        jButtonVoltar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltarActionPerformed(evt);
            }
        });

        jButtonEditar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png"))); // NOI18N
        jButtonEditar1.setContentAreaFilled(false);
        jButtonEditar1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png"))); // NOI18N
        jButtonEditar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditar1ActionPerformed(evt);
            }
        });

        jButtonAvancar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonAvancar1.setContentAreaFilled(false);
        jButtonAvancar1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonAvancar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAvancar1ActionPerformed(evt);
            }
        });

        jButtonRemover.setBackground(null);
        jButtonRemover.setForeground(null);
        jButtonRemover.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5].png"))); // NOI18N
        jButtonRemover.setBorderPainted(false);
        jButtonRemover.setContentAreaFilled(false);
        jButtonRemover.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5]over.png"))); // NOI18N
        jButtonRemover.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRemoverActionPerformed(evt);
            }
        });

        jButtonCadastrar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButtonCadastrar.setText("Cadastrar");
        jButtonCadastrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCadastrarActionPerformed(evt);
            }
        });

        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh.png"))); // NOI18N
        jButton8.setContentAreaFilled(false);
        jButton8.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh[2]over.png"))); // NOI18N
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jTableCaixaNovo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Caixa", "Razão Social", "Endereço", "Cidade", "Registro Civil", "Responsavel", "Contador", "Empresa"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(jTableCaixaNovo);

        jLabelCaixa.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabelCaixa.setText("Caixa");

        jButtonLimparCaixa.setText("Limpar");
        jButtonLimparCaixa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLimparCaixaActionPerformed(evt);
            }
        });

        jButtonSairCaixa.setText("Voltar");
        jButtonSairCaixa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSairCaixaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jDialogNovoCaixaLayout = new javax.swing.GroupLayout(jDialogNovoCaixa.getContentPane());
        jDialogNovoCaixa.getContentPane().setLayout(jDialogNovoCaixaLayout);
        jDialogNovoCaixaLayout.setHorizontalGroup(
            jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                        .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                                .addGap(13, 13, 13)
                                .addComponent(jLabelCaixa)
                                .addGap(675, 675, 675))
                            .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jButtonLimparCaixa)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonVoltar, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonEditar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonRemover, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jButtonAvancar1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(225, 225, 225)))
                        .addComponent(jButtonCadastrar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonSairCaixa)
                        .addGap(3, 3, 3))
                    .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane2))))
                .addContainerGap())
        );
        jDialogNovoCaixaLayout.setVerticalGroup(
            jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButtonCadastrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonSairCaixa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jDialogNovoCaixaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButtonEditar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                                    .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jButtonVoltar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jButtonRemover, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jButtonAvancar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
                    .addGroup(jDialogNovoCaixaLayout.createSequentialGroup()
                        .addComponent(jLabelCaixa)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButtonLimparCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jDialogConsultaCheque.setMaximumSize(new java.awt.Dimension(637, 567));
        jDialogConsultaCheque.setMinimumSize(new java.awt.Dimension(637, 567));
        jDialogConsultaCheque.setModal(true);
        jDialogConsultaCheque.setResizable(false);
        jDialogConsultaCheque.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabelPesquisar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelPesquisar.setText("Pesquisa");
        jDialogConsultaCheque.getContentPane().add(jLabelPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 18, -1, -1));

        jTextFieldPesquisar.setDocument(new LetraMaiuscula());
        jTextFieldPesquisar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldPesquisarKeyReleased(evt);
            }
        });
        jDialogConsultaCheque.getContentPane().add(jTextFieldPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(504, 15, 86, -1));

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("Dados do Cheque"));

        jLabelComp1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelComp1.setText("Comp:");

        jLabelBanco1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelBanco1.setText("Banco:");

        jLabelAgencia1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelAgencia1.setText("Agência:");

        jLabelConta1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelConta1.setText("Conta:");

        jLabelNumCheque1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelNumCheque1.setText("Cheque Nº:");

        jLabelOrigem1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem1.setText("Emitente:");

        jLabelDevolvido1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelDevolvido1.setText("Devolvido:");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " ", "Não", "Sim" }));

        jTextFieldComp.setDocument(new LetraMaiuscula());
        jTextFieldComp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCompActionPerformed(evt);
            }
        });

        jTextFieldBanco.setDocument(new LetraMaiuscula());

        jLabelValor1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelValor1.setText("Valor:");

        jLabelData1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelData1.setText("Data inicial:");

        jLabelData2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelData2.setText("Data final:");

        jLabelOrigem2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem2.setText("Mov. Entrada Inicial:");

        jLabelOrigem3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem3.setText("Mov. Entrada Final:");

        jLabelOrigem4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem4.setText("Mov. Saida Inicial:");

        jLabelOrigem5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelOrigem5.setText("Mov. Saida Final:");

        jLabelComp2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabelComp2.setText("Codigo Cheque:");

        jTextFieldCodigoCheque.setDocument(new LetraMaiuscula());
        jTextFieldCodigoCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldCodigoChequeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabelConta1)
                        .addGap(28, 28, 28)
                        .addComponent(jTextFieldConta, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(13, 13, 13)
                        .addComponent(jLabelNumCheque1)
                        .addGap(13, 13, 13)
                        .addComponent(jTextFieldNumCheque, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelDevolvido1)
                        .addGap(4, 4, 4)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabelValor1)
                        .addGap(32, 32, 32)
                        .addComponent(jMoneyFieldChequePesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelData1)
                        .addGap(10, 10, 10)
                        .addComponent(jDatePreInicial, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelData2)
                        .addGap(6, 6, 6)
                        .addComponent(jDatePreFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabelOrigem1)
                        .addGap(10, 10, 10)
                        .addComponent(jTextFieldEmitentePesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabelOrigem2)
                        .addGap(10, 10, 10)
                        .addComponent(jDateEntradaInicial, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(81, 81, 81)
                        .addComponent(jLabelOrigem3)
                        .addGap(10, 10, 10)
                        .addComponent(jDateEntradaFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabelOrigem4)
                        .addGap(23, 23, 23)
                        .addComponent(jDateSaidaInicial, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(81, 81, 81)
                        .addComponent(jLabelOrigem5)
                        .addGap(23, 23, 23)
                        .addComponent(jDateSaidaFinal, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabelComp2)
                                .addGap(18, 18, 18)
                                .addComponent(jTextFieldCodigoCheque, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabelComp1)
                                .addGap(29, 29, 29)
                                .addComponent(jTextFieldComp, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(12, 12, 12)
                        .addComponent(jLabelBanco1)
                        .addGap(38, 38, 38)
                        .addComponent(jTextFieldBanco, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabelAgencia1)
                        .addGap(15, 15, 15)
                        .addComponent(jTextFieldAgencia, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldCodigoCheque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabelComp2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldComp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldBanco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldAgencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelComp1)
                            .addComponent(jLabelBanco1)
                            .addComponent(jLabelAgencia1))))
                .addGap(6, 6, 6)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldConta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldNumCheque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelConta1)
                            .addComponent(jLabelNumCheque1)
                            .addComponent(jLabelDevolvido1))))
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabelValor1))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jMoneyFieldChequePesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(9, 9, 9)
                        .addComponent(jLabelData1))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jDatePreInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelData2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jDatePreFinal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(4, 4, 4)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabelOrigem1))
                    .addComponent(jTextFieldEmitentePesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelOrigem2)
                    .addComponent(jDateEntradaInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelOrigem3)
                    .addComponent(jDateEntradaFinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelOrigem4)
                    .addComponent(jDateSaidaInicial, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelOrigem5)
                    .addComponent(jDateSaidaFinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jDialogConsultaCheque.getContentPane().add(jPanel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 41, 608, -1));

        jTableConsultaCheque.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Código", "Mov Origem", "Mov Destino", "Banco", "Agência", "Conta", "Cheque Nº", "Data", "Devolvido", "Valor", "Emitente"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableConsultaCheque.getTableHeader().setReorderingAllowed(false);
        jScrollPane10.setViewportView(jTableConsultaCheque);
        jTableConsultaCheque.getColumnModel().getColumn(0).setMinWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(0).setPreferredWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(0).setMaxWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(1).setMinWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(1).setPreferredWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(1).setMaxWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(2).setMinWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(2).setPreferredWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(2).setMaxWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(3).setMinWidth(100);
        jTableConsultaCheque.getColumnModel().getColumn(3).setPreferredWidth(100);
        jTableConsultaCheque.getColumnModel().getColumn(3).setMaxWidth(100);
        jTableConsultaCheque.getColumnModel().getColumn(4).setMinWidth(70);
        jTableConsultaCheque.getColumnModel().getColumn(4).setPreferredWidth(70);
        jTableConsultaCheque.getColumnModel().getColumn(4).setMaxWidth(70);
        jTableConsultaCheque.getColumnModel().getColumn(5).setMinWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(5).setPreferredWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(5).setMaxWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(6).setMinWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(6).setPreferredWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(6).setMaxWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(7).setMinWidth(60);
        jTableConsultaCheque.getColumnModel().getColumn(7).setPreferredWidth(60);
        jTableConsultaCheque.getColumnModel().getColumn(7).setMaxWidth(60);
        jTableConsultaCheque.getColumnModel().getColumn(8).setMinWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(8).setPreferredWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(8).setMaxWidth(50);
        jTableConsultaCheque.getColumnModel().getColumn(9).setMinWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(9).setPreferredWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(9).setMaxWidth(80);
        jTableConsultaCheque.getColumnModel().getColumn(10).setMinWidth(200);
        jTableConsultaCheque.getColumnModel().getColumn(10).setPreferredWidth(200);
        jTableConsultaCheque.getColumnModel().getColumn(10).setMaxWidth(200);

        jDialogConsultaCheque.getContentPane().add(jScrollPane10, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 311, 608, 211));

        jLabelCheque1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabelCheque1.setText("Cheque");
        jDialogConsultaCheque.getContentPane().add(jLabelCheque1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 11, -1, -1));

        jLabel40.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/search[1].png"))); // NOI18N
        jDialogConsultaCheque.getContentPane().add(jLabel40, new org.netbeans.lib.awtextra.AbsoluteConstraints(594, 11, -1, -1));

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jButtonVoltar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonVoltar1.setContentAreaFilled(false);
        jButtonVoltar1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonVoltar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltar1ActionPerformed(evt);
            }
        });

        jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh.png"))); // NOI18N
        jButton9.setContentAreaFilled(false);
        jButton9.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh[2]over.png"))); // NOI18N
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButtonAvancar2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonAvancar2.setContentAreaFilled(false);
        jButtonAvancar2.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonAvancar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAvancar2ActionPerformed(evt);
            }
        });

        jButtonPesquisaAvancadaCheque.setText("Pesquisar");
        jButtonPesquisaAvancadaCheque.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPesquisaAvancadaChequeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(219, 219, 219)
                .addComponent(jButtonVoltar1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(41, 41, 41)
                .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(38, 38, 38)
                .addComponent(jButtonAvancar2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 141, Short.MAX_VALUE)
                .addComponent(jButtonPesquisaAvancadaCheque)
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButtonVoltar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(jButtonAvancar2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(jButtonPesquisaAvancadaCheque))
        );

        jDialogConsultaCheque.getContentPane().add(jPanel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 264, -1, -1));

        setTitle("Movimento de Caixa");
        setMinimumSize(new java.awt.Dimension(915, 690));
        setModalExclusionType(null);
        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setText("Caixa:");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 14, -1, -1));

        jComboBox_Caixa.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jComboBox_CaixaMouseClicked(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                jComboBox_CaixaMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                jComboBox_CaixaMouseReleased(evt);
            }
        });
        jComboBox_Caixa.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBox_CaixaItemStateChanged(evt);
            }
        });
        jComboBox_Caixa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_CaixaActionPerformed(evt);
            }
        });
        getContentPane().add(jComboBox_Caixa, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 10, 259, -1));

        jLabel4.setText("Saldo Atual R$");
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(696, 14, -1, -1));

        jTextField_Saldo.setEditable(false);
        jTextField_Saldo.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        getContentPane().add(jTextField_Saldo, new org.netbeans.lib.awtextra.AbsoluteConstraints(776, 11, 98, -1));

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Lançamento"));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel6.setText("Data:");
        jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 22, -1, -1));

        jLabel8.setText("Histórico:");
        jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 46, -1, -1));

        jLabel9.setText("Tipo:");
        jPanel2.add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 75, -1, -1));

        jLabel11.setText("Valor:");
        jPanel2.add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 164, -1, -1));

        jRadioButton_Credito.setText("Credito");
        jPanel2.add(jRadioButton_Credito, new org.netbeans.lib.awtextra.AbsoluteConstraints(265, 158, -1, -1));

        jRadioButton_Debito.setText("Debito");
        jPanel2.add(jRadioButton_Debito, new org.netbeans.lib.awtextra.AbsoluteConstraints(357, 158, -1, -1));

        jComboBox_Tipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_TipoActionPerformed(evt);
            }
        });
        jPanel2.add(jComboBox_Tipo, new org.netbeans.lib.awtextra.AbsoluteConstraints(87, 76, 113, -1));
        jPanel2.add(jDateChooser1, new org.netbeans.lib.awtextra.AbsoluteConstraints(87, 20, 120, -1));

        jButtonTipo.setBackground(null);
        jButtonTipo.setForeground(null);
        jButtonTipo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/folder[3].png"))); // NOI18N
        jButtonTipo.setToolTipText("Cadastro");
        jButtonTipo.setBorderPainted(false);
        jButtonTipo.setContentAreaFilled(false);
        jButtonTipo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonTipoActionPerformed(evt);
            }
        });
        jPanel2.add(jButtonTipo, new org.netbeans.lib.awtextra.AbsoluteConstraints(387, 76, 23, 21));

        jComboBox_Pagamento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cheque", "Banco", "Dinheiro" }));
        jComboBox_Pagamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox_PagamentoActionPerformed(evt);
            }
        });
        jPanel2.add(jComboBox_Pagamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(88, 133, 106, -1));

        jLabel12.setText("Pagamento:   ");
        jPanel2.add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 135, -1, -1));

        jButtonPagamento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/folder[3].png"))); // NOI18N
        jButtonPagamento.setToolTipText("Cadastro");
        jButtonPagamento.setAutoscrolls(true);
        jButtonPagamento.setBorderPainted(false);
        jButtonPagamento.setContentAreaFilled(false);
        jButtonPagamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPagamentoActionPerformed(evt);
            }
        });
        jPanel2.add(jButtonPagamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 133, 24, 20));

        jTextField_CodigoMov.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_CodigoMovActionPerformed(evt);
            }
        });
        jTextField_CodigoMov.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextField_CodigoMovFocusLost(evt);
            }
        });
        jTextField_CodigoMov.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTextField_CodigoMovKeyPressed(evt);
            }
        });
        jPanel2.add(jTextField_CodigoMov, new org.netbeans.lib.awtextra.AbsoluteConstraints(273, 76, 108, -1));

        jTextField_Pagamento.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextField_PagamentoFocusLost(evt);
            }
        });
        jPanel2.add(jTextField_Pagamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(347, 133, 33, -1));

        jLabel14.setText("Nome:");
        jPanel2.add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 106, -1, -1));

        cBox.setEditable(true);
        cBox.setSelectedItem("");
        cBox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cBoxMouseClicked(evt);
            }
        });
        cBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cBoxActionPerformed(evt);
            }
        });
        cBox.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                cBoxPropertyChange(evt);
            }
        });
        cBox.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                cBoxKeyPressed(evt);
            }
        });
        jPanel2.add(cBox, new org.netbeans.lib.awtextra.AbsoluteConstraints(87, 47, 294, -1));

        jLabel15.setText("Codigo:");
        jPanel2.add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(218, 79, -1, -1));

        jButtonHistorico.setBackground(null);
        jButtonHistorico.setForeground(null);
        jButtonHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/folder[3].png"))); // NOI18N
        jButtonHistorico.setBorderPainted(false);
        jButtonHistorico.setContentAreaFilled(false);
        jButtonHistorico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonHistoricoActionPerformed(evt);
            }
        });
        jPanel2.add(jButtonHistorico, new org.netbeans.lib.awtextra.AbsoluteConstraints(387, 47, 23, 20));
        jPanel2.add(jTextField_Nome_Pagamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(212, 133, 129, -1));

        jMoneyFieldValor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMoneyFieldValorActionPerformed(evt);
            }
        });
        jPanel2.add(jMoneyFieldValor, new org.netbeans.lib.awtextra.AbsoluteConstraints(88, 162, 106, -1));

        jTextField_NomeMov.setEditable(false);
        jTextField_NomeMov.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField_NomeMovActionPerformed(evt);
            }
        });
        jPanel2.add(jTextField_NomeMov, new org.netbeans.lib.awtextra.AbsoluteConstraints(87, 103, 323, -1));

        getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 38, 430, 190));

        jButton_Lancar.setText("Lançar");
        jButton_Lancar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_LancarActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_Lancar, new org.netbeans.lib.awtextra.AbsoluteConstraints(690, 580, 91, -1));

        jButton_Cancelar.setText("Cancelar");
        jButton_Cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_CancelarActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_Cancelar, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 580, 87, -1));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Lançamento", "Codigo", "Nome", "Dia", "Historico", "Tipo", "Credito", "Debito", "Pagamento"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.getTableHeader().setReorderingAllowed(false);
        jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);
        jTable1.getColumnModel().getColumn(0).setMinWidth(70);
        jTable1.getColumnModel().getColumn(0).setPreferredWidth(70);
        jTable1.getColumnModel().getColumn(0).setMaxWidth(70);
        jTable1.getColumnModel().getColumn(1).setMinWidth(50);
        jTable1.getColumnModel().getColumn(1).setPreferredWidth(50);
        jTable1.getColumnModel().getColumn(1).setMaxWidth(50);
        jTable1.getColumnModel().getColumn(2).setMinWidth(170);
        jTable1.getColumnModel().getColumn(2).setMaxWidth(170);
        jTable1.getColumnModel().getColumn(3).setMinWidth(70);
        jTable1.getColumnModel().getColumn(3).setMaxWidth(70);
        jTable1.getColumnModel().getColumn(4).setMinWidth(225);
        jTable1.getColumnModel().getColumn(4).setMaxWidth(225);
        jTable1.getColumnModel().getColumn(5).setMinWidth(70);
        jTable1.getColumnModel().getColumn(5).setMaxWidth(70);
        jTable1.getColumnModel().getColumn(6).setMinWidth(70);
        jTable1.getColumnModel().getColumn(6).setPreferredWidth(70);
        jTable1.getColumnModel().getColumn(6).setMaxWidth(70);
        jTable1.getColumnModel().getColumn(7).setMinWidth(70);
        jTable1.getColumnModel().getColumn(7).setPreferredWidth(70);
        jTable1.getColumnModel().getColumn(7).setMaxWidth(70);
        jTable1.getColumnModel().getColumn(8).setMinWidth(70);
        jTable1.getColumnModel().getColumn(8).setPreferredWidth(70);
        jTable1.getColumnModel().getColumn(8).setMaxWidth(70);

        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 276, 864, 290));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Usuario"));
        jPanel1.setMinimumSize(new java.awt.Dimension(280, 50));
        jPanel1.setOpaque(false);
        jPanel1.setPreferredSize(new java.awt.Dimension(280, 61));
        jPanel1.setRequestFocusEnabled(false);

        jLabel3.setText("Nome:");

        jLabel10.setText("Data:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 185, Short.MAX_VALUE)
                .addComponent(jLabel10)
                .addGap(161, 161, 161))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(0, 9, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)))
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(448, 38, 426, 50));

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel5.setMinimumSize(new java.awt.Dimension(50, 200));
        jPanel5.setOpaque(false);
        jPanel5.setPreferredSize(new java.awt.Dimension(50, 200));
        jPanel5.setRequestFocusEnabled(false);

        jTableChequesMovimento.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Codigo do Cheque", "Nome", "Valor", "Situacao"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTableChequesMovimento.getTableHeader().setReorderingAllowed(false);
        jScrollPane5.setViewportView(jTableChequesMovimento);
        jTableChequesMovimento.getColumnModel().getColumn(0).setMinWidth(120);
        jTableChequesMovimento.getColumnModel().getColumn(0).setPreferredWidth(120);
        jTableChequesMovimento.getColumnModel().getColumn(0).setMaxWidth(120);
        jTableChequesMovimento.getColumnModel().getColumn(1).setMinWidth(105);
        jTableChequesMovimento.getColumnModel().getColumn(1).setPreferredWidth(105);
        jTableChequesMovimento.getColumnModel().getColumn(1).setMaxWidth(105);
        jTableChequesMovimento.getColumnModel().getColumn(2).setMinWidth(100);
        jTableChequesMovimento.getColumnModel().getColumn(2).setPreferredWidth(100);
        jTableChequesMovimento.getColumnModel().getColumn(2).setMaxWidth(100);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 99, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 90, 426, 100));

        jButton_LimparMov.setText("Limpar");
        jButton_LimparMov.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_LimparMovActionPerformed(evt);
            }
        });
        getContentPane().add(jButton_LimparMov, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 580, -1, -1));

        Lancamento.setText("Novo Lançamento");
        getContentPane().add(Lancamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 10, -1, 20));

        jButtonNovoLancamento.setText("Novo Lancamento");
        jButtonNovoLancamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonNovoLancamentoActionPerformed(evt);
            }
        });
        getContentPane().add(jButtonNovoLancamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 580, 148, -1));

        jButtonPesquisaAvancada.setText("Pesquisar");
        jButtonPesquisaAvancada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonPesquisaAvancadaActionPerformed(evt);
            }
        });
        getContentPane().add(jButtonPesquisaAvancada, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 580, 112, -1));

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel8.setMaximumSize(new java.awt.Dimension(100, 57));
        jPanel8.setMinimumSize(new java.awt.Dimension(100, 40));
        jPanel8.setOpaque(false);
        jPanel8.setPreferredSize(new java.awt.Dimension(100, 61));
        jPanel8.setRequestFocusEnabled(false);
        jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jButton_Deletar.setBackground(null);
        jButton_Deletar.setForeground(null);
        jButton_Deletar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5].png"))); // NOI18N
        jButton_Deletar.setBorderPainted(false);
        jButton_Deletar.setContentAreaFilled(false);
        jButton_Deletar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5]over.png"))); // NOI18N
        jButton_Deletar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_DeletarActionPerformed(evt);
            }
        });
        jPanel8.add(jButton_Deletar, new org.netbeans.lib.awtextra.AbsoluteConstraints(397, 6, 30, -1));

        jButtonAvancar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2].png"))); // NOI18N
        jButtonAvancar.setContentAreaFilled(false);
        jButtonAvancar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/next[2]over.png"))); // NOI18N
        jButtonAvancar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonAvancarMouseClicked(evt);
            }
        });
        jButtonAvancar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAvancarActionPerformed(evt);
            }
        });
        jPanel8.add(jButtonAvancar, new org.netbeans.lib.awtextra.AbsoluteConstraints(433, 6, 27, -1));

        jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png"))); // NOI18N
        jButtonEditar.setContentAreaFilled(false);
        jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png"))); // NOI18N
        jButtonEditar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditarActionPerformed(evt);
            }
        });
        jPanel8.add(jButtonEditar, new org.netbeans.lib.awtextra.AbsoluteConstraints(332, 6, 27, -1));

        jButtonAtualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh.png"))); // NOI18N
        jButtonAtualizar.setContentAreaFilled(false);
        jButtonAtualizar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/refresh[2]over.png"))); // NOI18N
        jButtonAtualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAtualizarActionPerformed(evt);
            }
        });
        jPanel8.add(jButtonAtualizar, new org.netbeans.lib.awtextra.AbsoluteConstraints(365, 6, 26, -1));

        jButtonVolta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2].png"))); // NOI18N
        jButtonVolta.setContentAreaFilled(false);
        jButtonVolta.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/back[2]over.png"))); // NOI18N
        jButtonVolta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonVoltaMouseClicked(evt);
            }
        });
        jButtonVolta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltaActionPerformed(evt);
            }
        });
        jPanel8.add(jButtonVolta, new org.netbeans.lib.awtextra.AbsoluteConstraints(299, 6, 27, -1));

        jLabel13.setText("Movimento");
        jPanel8.add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(6, 6, -1, -1));

        jLabel2.setText("Filtro Nome:");
        jPanel8.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 10, -1, -1));

        jTextField_Pesquisa.setDocument(new LetraMaiuscula());
        jTextField_Pesquisa.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextField_PesquisaKeyReleased(evt);
            }
        });
        jPanel8.add(jTextField_Pesquisa, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 10, 116, -1));

        jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/search[1].png"))); // NOI18N
        jPanel8.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 10, -1, -1));

        getContentPane().add(jPanel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 230, 864, 40));

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel9.setMinimumSize(new java.awt.Dimension(280, 50));
        jPanel9.setOpaque(false);
        jPanel9.setPreferredSize(new java.awt.Dimension(280, 61));
        jPanel9.setRequestFocusEnabled(false);

        jButton_Deletar1.setBackground(null);
        jButton_Deletar1.setForeground(null);
        jButton_Deletar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5].png"))); // NOI18N
        jButton_Deletar1.setBorderPainted(false);
        jButton_Deletar1.setContentAreaFilled(false);
        jButton_Deletar1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/delete[5]over.png"))); // NOI18N
        jButton_Deletar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_Deletar1ActionPerformed(evt);
            }
        });

        jButtonEditarCheques.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png"))); // NOI18N
        jButtonEditarCheques.setContentAreaFilled(false);
        jButtonEditarCheques.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png"))); // NOI18N
        jButtonEditarCheques.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEditarChequesActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap(186, Short.MAX_VALUE)
                .addComponent(jButtonEditarCheques, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Deletar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(169, 169, 169))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jButton_Deletar1)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jButtonEditarCheques, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        getContentPane().add(jPanel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 190, 426, 37));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonVoltaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaActionPerformed
        BuscarLimiteAnterior();
        jButtonAvancar.setEnabled(true);
}//GEN-LAST:event_jButtonVoltaActionPerformed

    private void jButtonEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarActionPerformed

        if (jTable1.getSelectedRow() >= 0) { // Caso nao tenha sido selecionado nada na tabela da um aviso de erro
            if (ControlAlteraCadastra.equals("1")) { //se for 1 estamos no cadastra se 2 no editar

                try {

                    jButton_LimparMov.setEnabled(false);
                    jButtonNovoLancamento.setEnabled(false);
                    jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                    jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                    int k = jTable1.getSelectedRow();
                    cod_mov = (Integer) jTable1.getValueAt(k, 0);
                    SimpleDateFormat formatIso = new SimpleDateFormat("yyyy-MM-dd");
                    SimpleDateFormat formato = new SimpleDateFormat("dd-MM-yyyy");
                    MovimentoDao edao = new MovimentoDao();
                    HistoricoDao hdao = new HistoricoDao();
                    EntidadeDao ndao = new EntidadeDao();
                    UsuarioDao udao = new UsuarioDao();
                    Movimento m = edao.PesquisarMovimento(cod_mov); // funcao que pesquisa os movimentos
                    List<Entidade> listae = ndao.ListarEntidade();
                    List<Usuario> listau = udao.ListarUsuario();
                    String data = m.getData();
                    Date fe = m.getData_mov();
                    Date date = formatIso.parse(data);

                    jDateChooser1.setDate(date);
                    jLabel10.setText("Data do Movimento: " + formato.format(fe));
                    String a = "";
                    for (Entidade e : listae) {
                        for (Usuario u : listau) {
              int cod_entidade = (Integer) jTable1.getValueAt(k, 1);
              String nome_entidade = (String) jTable1.getValueAt(k, 2);
                           if (m.getMov_cod_entidade() == e.getCod_ent()) {
                               
                              cBox.setSelectedItem(m.getMov_historico());
                                if (m.getTipo() == 1) {
                                    jComboBox_Tipo.setSelectedIndex(0);
                                    jLabel3.setText("Codigo: " + jComboBox_Tipo.getSelectedItem() + "        Nome: " + u.getNome_usuario()); // Carrega o usuario que salvo o movimento 
                                } else if(m.getTipo() == 2) {
                                    jComboBox_Tipo.setSelectedIndex(1);
                                    jLabel3.setText("Codigo: " + jComboBox_Tipo.getSelectedItem() + "        Nome: " + u.getNome_usuario()); // Carrega o usuario que salvo o movimento 
                                }else if(m.getTipo() == 3) {
                                    jComboBox_Tipo.setSelectedIndex(2);
                                    jLabel3.setText("Codigo: " + jComboBox_Tipo.getSelectedItem() + "        Nome: " + u.getNome_usuario()); // Carrega o usuario que salvo o movimento 
                                }
                            }
                                jTextField_CodigoMov.setText(cod_entidade+""); 
                                jTextField_NomeMov.setText(nome_entidade+"");
                        }
                    }
                    Cheque c = null;
                    ChequeDao cdao = new ChequeDao();
                      if(jComboBox_Tipo.getSelectedIndex() == 0) {
                 
                    ChequeMovimentoOrigem(cod_mov);
                    
                         }else if (jComboBox_Tipo.getSelectedIndex() == 1) {
                       ChequeMovimentoDestino(cod_mov);
                    }
                         CarregaTabelaChequeCadastro();
                    
  // -------->  Vai carregar os cheque cadastrados na lista para poder ser alterado!
        
                 //   for(int h=0; jTableChequesMovimento.getRowCount()>=h; h++ ){
                                           
                 //   int cod = (Integer) jTableChequesMovimento.getValueAt(k, 0);

                 // modelo2.setRowCount(h);
                 
                 //   }               
                    
  // -----------> Sai da edicao de Cheque          
                         
                    jComboBox_Tipo.setEnabled(false);// desabilita o combo Tipo
                    int numerocheques = jTableChequesMovimento.getRowCount();
                    if (m.getPagamento().equals("Cheque")) {
                        jComboBox_Pagamento.setSelectedIndex(0);  
                        jComboBox_Pagamento.setEnabled(false);
                        jTextField_Pagamento.setText(Integer.toString(numerocheques));
                    } else if (m.getPagamento().equals("Banco")) {
                        jComboBox_Pagamento.setSelectedIndex(1);    
                        jComboBox_Pagamento.setEnabled(false);
                        jTextField_Pagamento.setText(Integer.toString(m.getMov_banco()));
                    } else if (m.getPagamento().equals("Dinheiro")) {
                        jComboBox_Pagamento.setSelectedIndex(2);
                        jTextField_Pagamento.setEditable(false);
                        jButtonPagamento.setEnabled(false);
                    }

                    if (m.getCredito() == 0.00) {

                        String debitos;
                        debitos = (String) jTable1.getValueAt(k, 7);
                        jMoneyFieldValor.setText(debitos);
                        jRadioButton_Credito.setSelected(false);
                        jRadioButton_Debito.setSelected(true);
                        jRadioButton_Debito.setEnabled(true);

                    } else if (m.getDebito() == 0.00) {

                        String creditos;
                        creditos = (String) jTable1.getValueAt(k, 6);
                        jMoneyFieldValor.setText(creditos);
                        jRadioButton_Credito.setSelected(true);
                        jRadioButton_Debito.setSelected(false);
                        jRadioButton_Credito.setEnabled(true);
                    }

                    ControlAlteraCadastra = "2"; // seta 2 pq estamos com o alterar habilitado
                    Lancamento.setText("Alterando Lançamento");
                    jButton_Lancar.setText("Alterar");                                
                    CarregaSaldo();
                    
                } catch (ParseException ex) {
                    Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                    JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonEditarActionPerformed");
                }
            } else { // saindo do Editar
                
                jDateChooser1.setDate(null);
                jTextField_CodigoMov.setText("");
                cBox.setSelectedItem(null);
                jTextField_NomeMov.setText("");
                jMoneyFieldValor.setText("");
                jTextField_Pagamento.setText("");
                cBox.setSelectedItem("");
                jRadioButton_Credito.setSelected(false);
                jRadioButton_Debito.setSelected(false);
                ControlAlteraCadastra = "1";
                jButton_Lancar.setText("Lançar");
                Lancamento.setText("Novo Lançamento");
                jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
                jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
                modelo2.setRowCount(0);
                jTableChequesMovimento.setModel(modelo2);
                jMoneyFieldValor.setText("");
                jButtonPagamento.setEnabled(true);
                jButton_LimparMov.setEnabled(true);
                jButtonEditarCheques.setEnabled(true);
                jButtonNovoLancamento.setEnabled(true);
                jMoneyFieldValor.setEnabled(true);
                jComboBox_Pagamento.setEnabled(true);
                jComboBox_Tipo.setEnabled(true);
                ChequesCadastrados.clear();
                cod_mov=0;
                CarregaTabelaChequePagar();
            }
        } else {
            JOptionPane.showMessageDialog(null, "Favor selecionar um Lançamento para ser alterado!");
        }
    }//GEN-LAST:event_jButtonEditarActionPerformed

    private void jButtonAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAtualizarActionPerformed
        CarregarCaixa();
        CarregarMovimentoCaixa();
        jButtonAvancar.setEnabled(true);
    }//GEN-LAST:event_jButtonAtualizarActionPerformed

    private void jButton_DeletarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_DeletarActionPerformed

        int linha;
        int k = jTable1.getSelectedRow();
        linha = (Integer) jTable1.getValueAt(k, 0);
        Object[] OPTIONS = {"Sim", "Não"};
        MovimentoDao mdao = new MovimentoDao();
        Movimento m = new Movimento();
        m.setCod_movimento(linha);

        try {
            int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja excluir o registro?", "Excluir", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);
            if (I == JOptionPane.YES_OPTION) {
                mdao.DeletarMovimento(m); // Deleta a linha do movimento que foi selecionada
                JOptionPane.showMessageDialog(null, "Excluído com sucesso!");
                CarregarMovimentoCaixa();
                CarregaSaldo();
            }
        } catch (Exception ex) {
            System.out.println("1 Excluir Movimento - " + ex.getMessage());
            JOptionPane.showMessageDialog(null, "Funcao do Movimento jButton_DeletarActionPerformed");
        }
    }//GEN-LAST:event_jButton_DeletarActionPerformed

    private void jButtonAvancarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAvancarActionPerformed
        BuscarLimiteProximo();
        jButtonVolta.setEnabled(true);
    }//GEN-LAST:event_jButtonAvancarActionPerformed

    private void jButton_LancarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LancarActionPerformed
         
        if (jComboBox_Caixa.getSelectedIndex() < 0) { // codigo para obrigar a preencher todos os campos
            JOptionPane.showMessageDialog(null, "Favor selecionar o Caixa!");
        } else if (jDateChooser1.getDate() == (null)) {
            JOptionPane.showMessageDialog(null, "Favor selecionar uma Data!");
        } else if (jComboBox_Tipo.getSelectedIndex() < 0) {
            JOptionPane.showMessageDialog(null, "Favor selecionar um Tipo!");
        } //else if (jTextField_Codigo.getText().equals("") && (jComboBox_Tipo.getSelectedIndex() != 3)) {
            else if (jTextField_CodigoMov.getText().equals("")) {
            JOptionPane.showMessageDialog(null, "Favor selecionar o Codigo do " + jComboBox_Tipo.getSelectedItem() + "!");
            jTextField_CodigoMov.requestFocus();
        } else if ((jComboBox_Pagamento.getSelectedIndex() != 2) && (jTextField_Pagamento.getText().equals("")) && (jComboBox_Pagamento.getSelectedIndex() != 0)) {
            JOptionPane.showMessageDialog(null, "Favor selecionar a forma de Pagamento!");
        } else if ((jTextField_Pagamento.getText().equals("")) && ((jComboBox_Pagamento.getSelectedIndex() == 0))) {
            JOptionPane.showMessageDialog(null, "Favor selecionar um Cheque!");
        } else if (jMoneyFieldValor.getText().equals("0.00")) {
            JOptionPane.showMessageDialog(null, "Favor preencher o Valor!");
            jMoneyFieldValor.requestFocus();
        } else {
            try {
                if (ControlAlteraCadastra.equals("1")) {  // caso a label tiver escrito movimento ele salva caso contrario altera
                    Movimento mv = new Movimento();
                    MovimentoDao mdao = new MovimentoDao();
                    EntidadeDao edao = new EntidadeDao();
                    HistoricoDao hdao = new HistoricoDao();
                    TipoDao tdao = new TipoDao();
                    int codmov = mdao.UltimoCodMov();
                    Date data = jDateChooser1.getDate();
                    SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
                    SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
                    String dataformatada = formatoBanco.format(data);
                    String dataformatadat = formato.format(data);
                    Caixa cx; // Cria um novo objeto caixa 
                    cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox      

                    ChequeDao cdao = new ChequeDao();
                    List<Movimento> mlista = mdao.ListarMovimento();
                    List<Entidade> listaent = edao.ListarEntidade();
                    List<Tipo> listatip = tdao.ListarTipo();
                    mv.setMov_caixa(cx.getCod_caixa());// salva o codigo do objeto selecionado 
                    mv.setData(dataformatada);
                    mv.setData_pre(null);
                    mv.setMov_historico(cBox.getSelectedItem().toString());
                    if (jTextField_CodigoMov.getText().equals("")) {
                        mv.setMov_cod_entidade(0);
                       
                    } else {
                        mv.setMov_cod_entidade(Integer.parseInt(jTextField_CodigoMov.getText()));
                    }
                    if (jComboBox_Tipo.getSelectedIndex() == 0) {
                        mv.setTipo(1);
                    } else if (jComboBox_Tipo.getSelectedIndex() == 1) {
                        mv.setTipo(2);
                    } 
                    else if (jComboBox_Tipo.getSelectedIndex() == 2) {
                        mv.setTipo(3);
                    }

                    if (jComboBox_Pagamento.getSelectedIndex() == 0) {
                        mv.setMov_cheque(Integer.parseInt(jTextField_Pagamento.getText()));
                        mv.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                    } else if (jComboBox_Pagamento.getSelectedIndex() == 1) {
                        mv.setMov_banco(Integer.parseInt(jTextField_Pagamento.getText()));
                        mv.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                    } else if (jComboBox_Pagamento.getSelectedIndex() == 2) {
                        mv.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                    }
                    double credito = 0, debito = 0;

                    if (jRadioButton_Credito.getSelectedObjects() != null) { //seleciona o RadioButton e salva Credito

                        converterDoubleDoisDecimais(credito, debito);
                        String cfredito = jMoneyFieldValor.getText();
                        cfredito = cfredito.replace(",", ".");

                        mv.setCredito(Double.parseDouble(cfredito));
                        mv.setDebito(debito);
                    }
                    if (jRadioButton_Debito.getSelectedObjects() != null) {//seleciona o RadioButton e salva Debito

                        converterDoubleDoisDecimais(credito, debito);
                        Double neg = (Double.parseDouble(jMoneyFieldValor.getText())) * -1;   //transforma o valor em negativo porque é um Debito                  
                        debito = neg;
                        String cfredito = Double.toString(debito);
                        cfredito = cfredito.replace(",", ".");

                        mv.setDebito(Double.parseDouble(cfredito));
                        mv.setCredito(credito);
                    }

                    int caixaselecionado = jComboBox_Caixa.getSelectedIndex();
                    if ((CaixasLancados.contains(caixaselecionado)) && (desejalancaroutro == 1)) {

                        JOptionPane.showMessageDialog(null, "Não e possivel Repetir lançamento neste Caixa. \n Escolha outro Caixa");
                    } else {

                        mv.setMov_usuario(codigousu);
                        Object[] OPTION = {"Sim", "Não"};
                        int L = JOptionPane.showOptionDialog(null, "Cadastrar Movimento?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTION, OPTION[0]);
                        if (L == JOptionPane.YES_OPTION) {
                           
                            indexCaixa = jComboBox_Caixa.getSelectedIndex();
                            CaixasLancados.add(indexCaixa); // adiciona o numero indice do combo de caixa selecionado na lista de caixas lançados
                            
                            //recebe o ID do ultimo movimento
                            ultimomovimento = mdao.CadastrarMovimento(mv); //cadastra o movimento no banco
                                                     
                            CarregarMovimentoCaixa();
                            CarregaSaldo();

                            if ((jComboBox_Tipo.getSelectedIndex() == 1) && (jComboBox_Pagamento.getSelectedIndex() == 0)) {  
                                int a = mdao.UltimoCodMov();   
                                AlteraSaidaDoCheque(a);// Update o Destino do Cheque                           
                            }
//                            if ((jComboBox_Tipo.getSelectedIndex() == 2) && (jComboBox_Pagamento.getSelectedIndex() == 0)) {
//                                int a = mdao.UltimoCodMov();
//                                AlteraCheque(a);// Update o Destino do Cheque
//                            }
                            if ((jComboBox_Tipo.getSelectedIndex() == 0) && (jComboBox_Pagamento.getSelectedIndex() == 0)) {
                             
                                jTextFieldComp1.setText("");
                                jTextFieldBanco1.setText("");
                                jTextFieldAgencia1.setText("");
                                jTextFieldConta1.setText("");
                                jTextFieldNumCheque1.setText("");
                                jMoneyFieldChequeCadastro.setText("");    
                                jDateChooserChequeCadastro.setDate(data);
                                jTextFieldEmitente.setText("");
                                DefaultTableModel modelocheque = (DefaultTableModel) jTableChequeCadastro.getModel();
                                DataAtualCheque();
                                modelocheque.setRowCount(0);
                                 
                                CadastraCheque(ChequesCadastrados); //cadastra os cheque do movimento
                                ChequesCadastrados.clear(); // limpa a lista de cheque para ser usada novamente
                                
                            }
                            //--> aqui termina o novo lançamento

                            //--> Começa o "Lançar em outro caixa"

                            // if((desejalancaroutro == 1)&&(CaixasLancados.size() < jComboBox_Caixa.getItemCount()) ){

                            if (CaixasLancados.size() < jComboBox_Caixa.getItemCount()) {

                                //se já estiver lançando em outro caixa e o numero de caixasa lançados for inferior ao numero de caixas disponíves
                                Object[] OPTIONS = {"Sim", "Não"};

                                int I = JOptionPane.showOptionDialog(null, "Deseja lançar em outro caixa?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);

                                if (I == JOptionPane.NO_OPTION) { // se selecionou opção não (não deseja lançar em outro caixa)

                                    desejalancaroutro = 0;
                                    indexCaixa = -1;
                                    Lancamento.setText("Novo Lançamento");
                                    jComboBox_Caixa.setSelectedIndex((Integer) CaixasLancados.get(0));//volta a seleção para o primeiro caixa que foi lançado
                                    CaixasLancados.clear();//limpa a lista de caixas lançados

                                    // apaga alguns campos que foram usandos para um novo cadastro...
                                    jDateChooser1.setDate(null);
                                    jTextField_CodigoMov.setText("");
                                    cBox.setSelectedItem(null);
                                    jTextField_NomeMov.setText("");
                                    jMoneyFieldValor.setText("");
                                    jTextField_Pagamento.setText("");
                                    jTextField_Nome_Pagamento.setText("");
                                    cBox.setSelectedItem("");
                                    jRadioButton_Credito.setSelected(false);
                                    jRadioButton_Debito.setSelected(false);
                                    modelo2.setRowCount(0);
                                    jTableChequesMovimento.setModel(modelo2);
                                    jButtonEditar.setEnabled(true);// habilita novamente ediçao de movimentos

                                } else { // caso queira lançar em outro Caixa, 
                                    //apaga os valores da tabela de cheques e o resultado,
                                    //pq nao pode cadastra o mesmo cheque em lancamentos diferentes    

                                    jButtonEditar.setEnabled(false);//desabilita o acesso a edição de movimentos
                                    desejalancaroutro = 1;// se =1 estamos lançando em outro caixa
                                    Lancamento.setText("Lançando em outro Caixa");
                                    jButtonNovoLancamento.setEnabled(true);
                                    Object[] OPTIONSS = {"Credito", "Debito"};

                                    int H = JOptionPane.showOptionDialog(null, "Qual a forma de Pagamento?", "Pagamento", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONSS, OPTIONSS[0]);
                                    if (H == JOptionPane.NO_OPTION) {

                                        jRadioButton_Debito.setEnabled(true);
                                        jRadioButton_Debito.setSelected(true);
                                        jRadioButton_Credito.setEnabled(false);
                                    } else {

                                        jRadioButton_Credito.setEnabled(true);
                                        jRadioButton_Credito.setSelected(true);
                                        jRadioButton_Debito.setEnabled(false);
                                    }
                                    modelo2.setRowCount(0);
                                    jTableChequesMovimento.setModel(modelo2);

                                    if (jComboBox_Pagamento.getSelectedIndex() == 0) {
                                        jMoneyFieldValor.setText("");
                                        jMoneyFieldValor.setEnabled(false);
                                        jTextField_Pagamento.setText("");
                                    }
                                    jComboBox_Tipo.setSelectedIndex(2); //sempre que esta lancando em outro caixa o tipo muda para "Outros"
                                    
                                }
                            } else {
                                desejalancaroutro = 0;
                                indexCaixa = -1;
                                Lancamento.setText("Novo Lançamento");
                                jComboBox_Caixa.setSelectedIndex((Integer) CaixasLancados.get(0));//volta a seleção para o primeiro caixa que foi lançado
                                CaixasLancados.clear();//limpa a lista de caixas lançados

                                // apaga alguns campos que foram usandos para um novo cadastro...
                                jDateChooser1.setDate(null);
                                jTextField_CodigoMov.setText("");
                                cBox.setSelectedItem(null);
                                jTextField_NomeMov.setText("");
                                jMoneyFieldValor.setText("");
                                jTextField_Pagamento.setText("");
                                jTextField_Nome_Pagamento.setText("");
                                cBox.setSelectedItem("");
                                jRadioButton_Credito.setSelected(false);
                                jRadioButton_Debito.setSelected(false);
                                modelo2.setRowCount(0);
                                jTableChequesMovimento.setModel(modelo2);
                                jButtonNovoLancamento.setEnabled(false);
                            }
                            //--> Termina o Lançar em outro Caixa
                        }
                    }
                } else {

                    Object[] OPTIONS = {"Sim", "Não"};

                    int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja alterar o registro?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);
                    if (I == JOptionPane.YES_OPTION) {

                        Movimento m = new Movimento();
                        MovimentoDao mdao = new MovimentoDao();
                        EntidadeDao edao = new EntidadeDao();
                        HistoricoDao hdao = new HistoricoDao();
                        TipoDao tdao = new TipoDao();
                        int codmov = mdao.UltimoCodMov();
                        Date data = jDateChooser1.getDate();

                        SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
                        SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
                        String dataformatada = formatoBanco.format(data);

                        String dataformatadat = formato.format(data);

                        Caixa cx; // Cria um novo objeto caixa 
                        cx = lista.get(jComboBox_Caixa.getSelectedIndex()); // pega o objeto da lista pelo selecionado com combobox      

                        List<Movimento> mlista = mdao.ListarMovimento();
                        List<Entidade> listaent = edao.ListarEntidade();
                        List<Tipo> listatip = tdao.ListarTipo();

                        m.setCod_movimento(cod_mov);
                        m.setMov_caixa(cx.getCod_caixa());// salva o codigo do objeto selecionado 
                        m.setData(dataformatada);

                        m.setMov_historico(cBox.getSelectedItem().toString());
                        m.setMov_cod_entidade(Integer.parseInt(jTextField_CodigoMov.getText()));

                        if (jComboBox_Tipo.getSelectedIndex() == 0) {
                            m.setTipo(1);
                        } else if(jComboBox_Tipo.getSelectedIndex() == 1){
                            m.setTipo(2);
                        } else if(jComboBox_Tipo.getSelectedIndex() == 2){
                            m.setTipo(3);
                        }
                        if (jComboBox_Pagamento.getSelectedIndex() == 0) {
                            m.setMov_cheque(Integer.parseInt(jTextField_Pagamento.getText()));
                            m.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                        } else if (jComboBox_Pagamento.getSelectedIndex() == 1) {
                            m.setMov_banco(Integer.parseInt(jTextField_Pagamento.getText()));
                            m.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                        } else if (jComboBox_Pagamento.getSelectedIndex() == 2) {
                            m.setPagamento(jComboBox_Pagamento.getSelectedItem().toString());
                        }
                        double credito = 0, debito = 0;

                        if (jRadioButton_Credito.getSelectedObjects() != null) { //seleciona o RadioButton e salva Credito

                            converterDoubleDoisDecimais(credito, debito);
                            credito = (Double.parseDouble(jMoneyFieldValor.getText()));
                            m.setCredito(credito);
                            m.setDebito(debito);
                        }
                        if (jRadioButton_Debito.getSelectedObjects() != null) {//seleciona o RadioButton e salva Debito

                            converterDoubleDoisDecimais(credito, debito);
                            Double neg = (Double.parseDouble(jMoneyFieldValor.getText())) * -1;   //transforma o valor em negativo porque é um Debito                  
                            debito = neg;
                            m.setDebito(debito);
                            m.setCredito(credito);
                        }
                        
                        //------ Faz todas as funcoes que envolve o cheque quando for Cliente
                        
         if ((jComboBox_Pagamento.getSelectedIndex() == 0)&&(jComboBox_Tipo.getSelectedIndex()==0)) { // se combobox for cheque
                
             
             ChequeDao cdao = new ChequeDao(); 
                    
             for (int i = 0; i < ChequesCadastrados.size(); i++) {
               
                   if(ChequesCadastrados.get(i).getStatus().equals("Novo")){  //add cheque "Novo"  
                    
                    cdao.CadastrarCheque(ChequesCadastrados.get(i), cod_mov);
                   }
                   if(ChequesCadastrados.get(i).getStatus().equals("Cadastrado")){ // altera cheque "Cadastrados"
                      
                       cdao.AlterarCheque(ChequesCadastrados.get(i));   
                   } 
                   if(ChequesCadastrados.get(i).getStatus().equals("Excluir")){ //exclui cheque " Excluir"
                     
                       cdao.DeletarCheque(ChequesCadastrados.get(i).getCod_cheque());   
                   }
        }                                    
                            }    //------ Faz todas as funcoes que envolve o cheque quando for Fornecedor
         else{
          
                ChequeDao cdao = new ChequeDao(); 
                System.out.println("lista - "+ChequesCadastrados.size());
                
             for (int i = 0; i < ChequesCadastrados.size(); i++) {
              
                           
                   if(ChequesCadastrados.get(i).getStatus().equals("Excluir")){ //exclui cheque " Excluir"
                   
                       cdao.AlterarSaidaChequeParaNULL(ChequesCadastrados.get(i).getCod_cheque());  
                      
                   }
                   if(ChequesCadastrados.get(i).getStatus().equals("Novo")){  //add cheque "Novo"  
                            
                       AlteraSaidaDoChequeUpdate(ChequesCadastrados.get(i).getCod_cheque());
                   
                   }
                   if(ChequesCadastrados.get(i).getStatus().equals("Cadastrado")){ // altera cheque "Cadastrados"
                       System.out.println("entrou no if");
  
                       cdao.AlterarSaidaCheque(ChequesCadastrados.get(i).getCod_cheque(), cod_mov);
                   } 
                   
               
        }                      
         }
              CarregaTabelaChequePagar();
              JOptionPane.showMessageDialog(null, "Alterado com sucesso!");                 
                        //-------------------------
                             
                        m.setMov_usuario(codigousu);
                        mdao.AlterarMovimento(m); //cadastra o movimento no banco
                        CarregarMovimentoCaixa();
                        CarregaSaldo();
                        novo = 1; //volta a variavel a 1 para recomecar contagem do codigo dos novos cheques

                        jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
                        jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));

                        jDateChooser1.setDate(null);

                        jTextField_CodigoMov.setText("");
                        cBox.setSelectedItem(null);
                        jTextField_NomeMov.setText("");
                        jMoneyFieldValor.setText("");
                        jTextField_Pagamento.setText("");
                        cBox.setSelectedItem("");
                        jTextField_Nome_Pagamento.setText("");
                        jRadioButton_Credito.setSelected(false);
                        jRadioButton_Debito.setSelected(false);
                        ControlAlteraCadastra = "1";
                        jButton_Lancar.setText("Lançar");
                        modelo2.setRowCount(0);
                        jTableChequesMovimento.setModel(modelo2);

                        if (I == JOptionPane.NO_OPTION) {

                            // apaga alguns campos que foram usandos para um novo cadastro...
                            jDateChooser1.setDate(null);

                            jTextField_CodigoMov.setText("");
                            cBox.setSelectedItem(null);
                            jTextField_NomeMov.setText("");
                            jMoneyFieldValor.setText("");
                            jTextField_Pagamento.setText("");
                            cBox.setSelectedItem("");
                            jRadioButton_Credito.setSelected(false);
                            jRadioButton_Debito.setSelected(false);
                            ControlAlteraCadastra = "1";
                            jButton_Lancar.setText("Lançar");
                        }
                    }
                }
            } catch (Exception ex) {
                System.out.println("1 - Lanca Movimento - " + ex.getMessage());
                JOptionPane.showMessageDialog(null, "Funcao do Movimento jButton_LancarActionPerformed");
            }
        }
}//GEN-LAST:event_jButton_LancarActionPerformed

    private void jButton_CancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_CancelarActionPerformed
              
        hide();
}//GEN-LAST:event_jButton_CancelarActionPerformed

    private void jComboBox_CaixaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_CaixaMouseClicked
          
    }//GEN-LAST:event_jComboBox_CaixaMouseClicked

    private void jComboBox_CaixaMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_CaixaMouseReleased
            
    }//GEN-LAST:event_jComboBox_CaixaMouseReleased

    private void jComboBox_CaixaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_CaixaActionPerformed
 
        CarregarMovimentoCaixa();
        CarregaSaldo();  

        if ((ControlAlteraCadastra.equals("2")) && ((desejalancaroutro == 1))) {//se ControlAlteraCadastra for 1 estamos no cadastra se 2 no editar
            LimparTelaMovimento();                                              //se desejalancaroutro for 0 esta cadastrando um NOVO, se for 1 esta cadastrando em outro caixa
            ChequesCadastrados.removeAll(ChequesCadastrados);        
                CarregaTabelaChequeCadastro();
        }
    }//GEN-LAST:event_jComboBox_CaixaActionPerformed

    private void jTextField_PesquisaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField_PesquisaKeyReleased
         
        CarregarMovimentoLetra();
    }//GEN-LAST:event_jTextField_PesquisaKeyReleased

    private void jComboBox_CaixaMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_CaixaMousePressed
         
    }//GEN-LAST:event_jComboBox_CaixaMousePressed

    private void jComboBox_CaixaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox_CaixaItemStateChanged
         
    }//GEN-LAST:event_jComboBox_CaixaItemStateChanged

private void jButtonOkEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkEntidadeActionPerformed
 
    jTextField_CodigoMov.setText(jTextFieldPesquisaEntidadeDialog.getText());
    jDialogListaEntidade.setVisible(false);
    jTextField_CodigoMov.requestFocus();
    PreencheoNomedaEntidade(); //preenche o nome da entidade quando selecionado o codigo
}//GEN-LAST:event_jButtonOkEntidadeActionPerformed

private void jButtonVoltarEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltarEntidadeActionPerformed
 
    jDialogListaEntidade.setVisible(false);
}//GEN-LAST:event_jButtonVoltarEntidadeActionPerformed

private void jButtonNovoEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNovoEntidadeActionPerformed
 
    jTextFieldCadEntNome.setText("");
    jTextFieldCadEntEndereco.setText("");
    jTextFieldCadEntBairro.setText("");
    jTextFieldUF.setValue(null);
    jTextFieldCadEntCidade.setText("");
    //  jTextFieldCep.setText("");
    jTextFieldCadEntCep.setValue(null);
    jTextFieldDDD.setValue(null);
    jTextFieldCadEntTelefone.setValue(null);
    //      jTextFieldCpf.setText("");
    jTextFieldCadEntCpf.setValue(null);
    jTextFieldCadEntRg.setValue(null);
    jTextFieldCadEntObs.setText("");
    jTextFieldCadEntApelido.setText("");
    jTextFieldCadEntIE.setText("");
    jTextFieldCNPJ.setValue(null);
    jDialogCadEntidade.setLocationRelativeTo(jDialogCadEntidade);
    jDialogCadEntidade.setVisible(true);
}//GEN-LAST:event_jButtonNovoEntidadeActionPerformed

private void jButtonAdicionaChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAdicionaChequeActionPerformed
     
    if (jTextFieldBanco1.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o campo Banco!");
    } else if(jTextFieldAgencia1.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o campo Agencia!");
    } else if(jTextFieldComp1.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o campo Complemento!");
    } else if(jTextFieldEmitente.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o campo Emitente!");
    } else if(jTextFieldConta1.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o compo Conta!");
    } else if(jTextFieldNumCheque1.getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Favor preencher o campo Cheque N.!");
    } else if(jDateChooserChequeCadastro.getDate() == (null)) {
            JOptionPane.showMessageDialog(null, "Favor selecionar uma Data!");
    } else if(jMoneyFieldChequeCadastro.getText().equals("0.00")){
            JOptionPane.showMessageDialog(null, "Favor preencher o campo Valor!");
    }

    else{

        try {
            if (jLabelCheque.getText().equals("Cheque")) {

                Date data = jDateChooserChequeCadastro.getDate();
                SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal
                SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco
                String dataformatada = formatoBanco.format(data);               
                Cheque cheque2 = new Cheque();
                ChequeDao cdao = new ChequeDao();
                EntidadeDao edao = new EntidadeDao();
                int codban = cdao.UltimoCodCheque();
                cheque2.setCod_cheque(novo++); 
                cheque2.setBanco(jTextFieldBanco1.getText());
                cheque2.setAgencia(jTextFieldAgencia1.getText());
                cheque2.setComp(jTextFieldComp1.getText());
                cheque2.setNum_cheque(jTextFieldNumCheque1.getText());
                int saida = -1;
                cheque2.setSaida_ck(saida);
                cheque2.setConta(jTextFieldConta1.getText());
                String cfredito = jMoneyFieldChequeCadastro.getText();
                cfredito = cfredito.replace(",", ".");
                cheque2.setValor_cheque(Double.parseDouble(cfredito));
                cheque2.setData(dataformatada);
                cheque2.setStatus("Novo");
                cheque2.setEmitente(jTextFieldEmitente.getText());
                cheque2.setDevolvido(jComboBoxSituacaoCheque.getSelectedItem().toString());
                   
                    ChequesCadastrados.add(cheque2); //  Adiciona os valores a Lista

                    CarregaTabelaChequeCadastro();
                    SomaChequesMov();

                    int numerocheques = jTableChequeCadastro.getRowCount();
                    jTextField_Pagamento.setText(Integer.toString(numerocheques));
                
            } else {
                Object[] OPTIONS = {"Sim", "Não"};

                int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja alterar o registro?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);
                if (I == JOptionPane.YES_OPTION) {
                         
                    ChequeDao cdao = new ChequeDao();             
                    Date data = jDateChooserChequeCadastro.getDate();          
                    SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy");   //converte para a data normal             
                    SimpleDateFormat formatoBanco = new SimpleDateFormat("yyyy-MM-dd");  // converte para a data do banco        
                    String dataformatada = formatoBanco.format(data);
             
                    cheque.setBanco(jTextFieldBanco1.getText());
                    cheque.setAgencia(jTextFieldAgencia1.getText());
                    cheque.setComp(jTextFieldComp1.getText());
                    cheque.setNum_cheque(jTextFieldNumCheque1.getText());
                    cheque.setConta(jTextFieldConta1.getText());
                    String cfredito = jMoneyFieldChequeCadastro.getText();
                    cfredito = cfredito.replace(",", ".");
                    cheque.setValor_cheque(Double.parseDouble(cfredito));
                    cheque.setData(dataformatada);
                    cheque.setDevolvido(jComboBoxSituacaoCheque.getSelectedItem().toString());
                    cheque.setEmitente(jTextFieldEmitente.getText());

                int codigo_cheque = cheque.getCod_cheque(); 
                SetCheque(codigo_cheque, cheque);
                CarregaTabelaChequeCadastro();
                SomaChequesMov();
                }
                JOptionPane.showMessageDialog(null, "Alterado com sucesso!");

                jTextFieldComp1.setText("");
                jTextFieldBanco1.setText("");
                jTextFieldAgencia1.setText("");
                jTextFieldConta1.setText("");
                jTextFieldNumCheque1.setText("");
                jMoneyFieldChequeCadastro.setText("");
                jDateChooserChequeCadastro.setDate(null);
                jTextFieldEmitente.setText("");
                jLabelCheque.setText("Cheque");
                jButtonAdicionaCheque.setText("Adicionar");
              
                jButtonEditarCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
                jButtonEditarCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
            }
        } catch (Exception e) {
            System.out.println("1 Cadastra Cheque Movimento - " + e.getMessage());
            JOptionPane.showMessageDialog(null, "Funcao do Movimento CarregaTabelaChequeCadastro");
        }
          jTextFieldComp1.setText("");
                jTextFieldBanco1.setText("");
                jTextFieldAgencia1.setText("");
                jTextFieldConta1.setText("");
                jTextFieldNumCheque1.setText("");
                jMoneyFieldChequeCadastro.setText("");
                jDateChooserChequeCadastro.setDate(null);
                jTextFieldEmitente.setText("");
                jLabelCheque.setText("Cheque");
                jButtonAdicionaCheque.setText("Adicionar");
    }

}//GEN-LAST:event_jButtonAdicionaChequeActionPerformed

private void jButtonVoltaChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaChequeActionPerformed
     
    jDialogListaCheque.setVisible(false);
}//GEN-LAST:event_jButtonVoltaChequeActionPerformed

private void jButtonOkBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkBancoActionPerformed
     
    jTextField_Nome_Pagamento.setText(nomebanco);
    jTextField_Pagamento.setText(jTextFieldDialogPesquisaBanco.getText());
    jTextField_Pagamento.requestFocus();
    jDialogListaBanco.setVisible(false);
    jTextField_Pagamento.requestFocus();
    jMoneyFieldValor.requestFocus();

    for (int h = 0; h < modelock.getRowCount(); h++) {
        modelock.setValueAt(false, h, 8);
    }
    modelo2.setRowCount(0);
    jTableChequesMovimento.setModel(modelo2);
}//GEN-LAST:event_jButtonOkBancoActionPerformed

private void jButtonNovoBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNovoBancoActionPerformed
     
    jDialogCadBanco.setLocationRelativeTo(jDialogCadBanco);
    jDialogCadBanco.setVisible(true);
    
}//GEN-LAST:event_jButtonNovoBancoActionPerformed

private void jButtonVoltaBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaBancoActionPerformed
     
    jDialogListaBanco.setVisible(false);
    
}//GEN-LAST:event_jButtonVoltaBancoActionPerformed

private void jButtonCadastrarEntidadeMovimentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastrarEntidadeMovimentoActionPerformed
     
    try {
        Entidade e = new Entidade();
        EntidadeDao edao = new EntidadeDao();

        e.setUF(jTextFieldUF.getText());
        e.setDDD(jTextFieldDDD.getText());
        e.setApelido(jTextFieldCadEntApelido.getText());
        e.setIE(jTextFieldCadEntIE.getText());
        e.setCnpj(jTextFieldCNPJ.getText());
        e.setNome_ent(jTextFieldCadEntNome.getText());
        e.setEnd(jTextFieldCadEntEndereco.getText());
        e.setBairro(jTextFieldCadEntBairro.getText());
        e.setCidade(jTextFieldCadEntCidade.getText());
        e.setCep(jTextFieldCadEntCep.getText());
        e.setTelefone(jTextFieldCadEntTelefone.getText());
        e.setCpf(jTextFieldCadEntCpf.getText());
        e.setRg(jTextFieldCadEntRg.getText());
        e.setObs(jTextFieldCadEntObs.getText());
        edao.CadastrarEntidade(e);
        jDialogCadEntidade.setVisible(false);
        JOptionPane.showMessageDialog(jDialogListaEntidade, "Cadastro realizado");

        CarregarEntidade();
    } catch (Exception ex) {
        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
        JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonAdicionaChequeActionPerformed");
    }
}//GEN-LAST:event_jButtonCadastrarEntidadeMovimentoActionPerformed

private void jButtonCadastraBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastraBancoActionPerformed
     
    try {
        Banco b = new Banco();
        BancoDao bdao = new BancoDao();

        b.setBanco(jTextFieldNomeBanco.getText());
        b.setAgencia(jTextFieldAgenciaBanco.getText());
        b.setConta(jTextFieldContaBanco.getText());
        bdao.CadastrarBanco(b);
        JOptionPane.showMessageDialog(null, "Cadastro realizado");
        jTextField_Pagamento.requestFocus();
        jDialogCadBanco.setVisible(false);
        jTextField_Pagamento.requestFocus();
        jMoneyFieldValor.requestFocus();

    } catch (Exception ex) {
        Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
        JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonCadastraBancoActionPerformed");
    }
}//GEN-LAST:event_jButtonCadastraBancoActionPerformed

private void jTextFieldAgenciaBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldAgenciaBancoActionPerformed
     
}//GEN-LAST:event_jTextFieldAgenciaBancoActionPerformed

private void jButtonAtualizaBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAtualizaBancoActionPerformed
     
    CarregarBanco();
    
}//GEN-LAST:event_jButtonAtualizaBancoActionPerformed

private void jButtonAtualizaEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAtualizaEntidadeActionPerformed
     
    CarregarEntidade();
    
}//GEN-LAST:event_jButtonAtualizaEntidadeActionPerformed

private void jTableBancoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableBancoMouseClicked
     
    int VarTemp;
    int k = jTableBanco.getSelectedRow();
    VarTemp = (Integer) jTableBanco.getValueAt(k, 0);
    
    if (evt.getClickCount() == 1) {
        nomebanco = (String) jTableBanco.getValueAt(k, 1);
        jTextFieldDialogPesquisaBanco.setText(Integer.toString(VarTemp));
    } else if (evt.getClickCount() == 2) {

        nomebanco = (String) jTableBanco.getValueAt(k, 1);
        jTextField_Pagamento.setText(Integer.toString(VarTemp));
        jTextField_Nome_Pagamento.setText(nomebanco);
        jDialogListaBanco.setVisible(false);
        jTextField_Pagamento.requestFocus();
        jMoneyFieldValor.requestFocus();
        
        if (jTableChequesMovimento.getRowCount() == 0) {
            
        } else {
            modelo2.setRowCount(0);
            jTableChequesMovimento.setModel(modelo2);
        }
        for (int h = 0; h < modelock.getRowCount(); h++) {
            modelock.setValueAt(false, h, 8);
        }
    }
}//GEN-LAST:event_jTableBancoMouseClicked

private void jButtonVoltaEntidadeMovimentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaEntidadeMovimentoActionPerformed
     
    jDialogCadEntidade.setVisible(false);
    
}//GEN-LAST:event_jButtonVoltaEntidadeMovimentoActionPerformed

private void jTableEntidadeChequeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableEntidadeChequeMouseClicked
     
    if (variavelglobal == 1) {

        int VarTemp;
        int k = jTableEntidadeCheque.getSelectedRow();
        VarTemp = (Integer) jTableEntidadeCheque.getValueAt(k, 0);
        
        if (evt.getClickCount() == 1) {
            
        } else if (evt.getClickCount() == 2) {
            jTextFieldEmitente.setText(Integer.toString(VarTemp));
            jDialogEntCheque.setVisible(false);
            jTextFieldEmitente.requestFocus();
        }
    } else {
        
        int VarTemp;
        int k = jTableEntidadeCheque.getSelectedRow();
        VarTemp = (Integer) jTableEntidadeCheque.getValueAt(k, 0);
        
        if (evt.getClickCount() == 1) {
            
        } else if (evt.getClickCount() == 2) {
            jDialogEntCheque.setVisible(false);
        }
    }
}//GEN-LAST:event_jTableEntidadeChequeMouseClicked

private void jTableEntidadeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableEntidadeMouseClicked
     
    int VarTemp;
    int k = jTableEntidade.getSelectedRow();
    VarTemp = (Integer) jTableEntidade.getValueAt(k, 0);

    if (evt.getClickCount() == 1) {
        jTextFieldPesquisaEntidadeDialog.setText(Integer.toString(VarTemp));
    } else if (evt.getClickCount() == 2) {
        jTextField_CodigoMov.setText(Integer.toString(VarTemp));
        jDialogListaEntidade.setVisible(false);
        jTextField_CodigoMov.requestFocus();     
        jComboBox_Pagamento.requestFocus();
        PreencheoNomedaEntidade();//preenche o nome da entidade quando selecionado o codigo
}//GEN-LAST:event_jTableEntidadeMouseClicked
    }
   private void jButtonProximoEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonProximoEntidadeActionPerformed
       paginacao = 2;
       BuscarLimiteProximoDialog();
   }//GEN-LAST:event_jButtonProximoEntidadeActionPerformed

   private void jButtonAnteriorEntidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAnteriorEntidadeActionPerformed
       paginacao = 3;
       BuscarLimiteAnteriorDialog();
}//GEN-LAST:event_jButtonAnteriorEntidadeActionPerformed

   private void jButtonAvancaCadBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAvancaCadBancoActionPerformed
       paginacao = 6;
       BuscarLimiteProximoDialog();
   }//GEN-LAST:event_jButtonAvancaCadBancoActionPerformed

   private void jButtonVoltaCadBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaCadBancoActionPerformed
       paginacao = 5;
       BuscarLimiteAnteriorDialog();        
}//GEN-LAST:event_jButtonVoltaCadBancoActionPerformed

   private void jButtonVoltaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonVoltaMouseClicked
      
   }//GEN-LAST:event_jButtonVoltaMouseClicked

   private void jButtonAvancarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonAvancarMouseClicked
        
   }//GEN-LAST:event_jButtonAvancarMouseClicked

   private void jButtonAtualizaHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAtualizaHistoricoActionPerformed
     
       CarregarHistorico();
       
   }//GEN-LAST:event_jButtonAtualizaHistoricoActionPerformed

   private void jButtonOkHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkHistoricoActionPerformed
        
       int k = jTableHistorico.getSelectedRow();
       String novohistoric = (String) jTableHistorico.getValueAt(k, 1);
   //    cBox.setSelectedItem(novohistorico);
       
       jDialogListaHistorico.setVisible(false);
       jComboBox_Tipo.requestFocus();
       cBox.setSelectedItem(novohistoric);
       atualizahistorico = 1;
       
   }//GEN-LAST:event_jButtonOkHistoricoActionPerformed

   private void jButtonVoltaHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaHistoricoActionPerformed
        
   }//GEN-LAST:event_jButtonVoltaHistoricoActionPerformed

   private void jButtonAvancaHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAvancaHistoricoActionPerformed
        
   }//GEN-LAST:event_jButtonAvancaHistoricoActionPerformed

   private void jButtonVoltarHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltarHistoricoActionPerformed
        
       jDialogListaHistorico.setVisible(false);
       
   }//GEN-LAST:event_jButtonVoltarHistoricoActionPerformed

   private void jTableHistoricoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableHistoricoMouseClicked
        
       String VarTemp;
       int k = jTableHistorico.getSelectedRow();
       VarTemp = (String) jTableHistorico.getValueAt(k, 1);
       if (evt.getClickCount() == 1) {
         //jTextFieldDialogPesquisaHistorico.setText(VarTemp);
           cBox.setSelectedItem(VarTemp);
       } else if (evt.getClickCount() == 2) {
           cBox.setSelectedItem(VarTemp);
           jDialogListaHistorico.setVisible(false);
           jComboBox_Tipo.requestFocus();
       }
   }//GEN-LAST:event_jTableHistoricoMouseClicked

   private void jButtonCadastrarHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastrarHistoricoActionPerformed
 
       if (jTextFieldDialogPesquisaHistorico.getText().isEmpty()) {
            JOptionPane.showMessageDialog(this, "Favor preencher os campos!");
        } else {
      try {
           if (jLabelHistorico.getText().equals("Historico")) {           
           Historico h = new Historico();
           HistoricoDao hdao = new HistoricoDao();
           int codhis = hdao.UltimoCodHistorico();
           h.setHistorico(jTextFieldDialogPesquisaHistorico.getText());
           hdao.CadastrarHistorico(h);
           CarregarHistorico();
           novohistorico = jTextFieldDialogPesquisaHistorico.getText();
           JOptionPane.showMessageDialog(null, "Cadastro realizado");
           jTextFieldDialogPesquisaHistorico.setText("");
           jTextFieldDialogPesquisaHistorico.requestFocus();
           jTableHistorico.setRowSelectionInterval(0, 0); 
             }else{
                                     Object[] OPTIONS = {"Sim", "Não"};

                    int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja alterar o registro?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);

                    if (I == JOptionPane.YES_OPTION) {
                        Historico h = new Historico();
                        h.setCod_historico(cod_historico_edita);
                        h.setHistorico(jTextFieldDialogPesquisaHistorico.getText());
                        HistoricoDao hdao = new HistoricoDao();
                        hdao.AlterarHistorico(h);
                        jTextFieldDialogPesquisaHistorico.setText("");
                        jTextFieldDialogPesquisaHistorico.requestFocus();
                        jLabelHistorico.setText("Historico");
                        jButtonCadastrarHistorico.setText("Cadastrar");
                        jButtonEditarHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
                        jButtonEditarHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
                    }
                    CarregarHistorico();   
             } 
       } catch (Exception ex) {
           Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
           JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonCadastrarHistoricoActionPerformed");
       }
       }

   }//GEN-LAST:event_jButtonCadastrarHistoricoActionPerformed

   private void jButtonVoltaCadastraBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltaCadastraBancoActionPerformed
        
       jDialogCadBanco.setVisible(false);
   }//GEN-LAST:event_jButtonVoltaCadastraBancoActionPerformed

   private void jTextFieldComp1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldComp1ActionPerformed
        
}//GEN-LAST:event_jTextFieldComp1ActionPerformed

   private void jButtonEditarChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarChequeActionPerformed

       if (jTableChequeCadastro.getSelectedRow() >= 0) { // Caso nao tenha sido selecionado nada na tabela da um aviso de erro
           if (jLabelCheque.getText().equals("Cheque")) { //se for 1 estamos no cadastra se 2 no editar
               jButtonEditarCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
               jButtonEditarCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));

            //   try {
                   int k = jTableChequeCadastro.getSelectedRow();
                   int cod_che = (Integer) jTableChequeCadastro.getValueAt(k, 0);
                   indiceTabelaCh = (Integer) jTableChequeCadastro.getValueAt(k, 0)-1;          
                   cheque = GetCheque(cod_che);
                   
             try {  
                   jTextFieldComp1.setText(cheque.getComp());
                   jTextFieldAgencia1.setText(cheque.getAgencia());
                   jTextFieldConta1.setText(cheque.getConta());
                   jTextFieldNumCheque1.setText(cheque.getNum_cheque());
                   jTextFieldBanco1.setText(cheque.getBanco());
                   jTextFieldEmitente.setText(cheque.getEmitente());
                   SimpleDateFormat formatIso = new SimpleDateFormat("yyyy-MM-dd");

     
                   String date = (cheque.getData());           
                   Date datatabela = formatIso.parse(date); 
                   jDateChooserChequeCadastro.setDate(datatabela);
                   
                  } catch (ParseException ex) {
                   Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                   JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonEditarChequeActionPerformed");
                  }
                  
                   if (cheque.getDevolvido().equals("sim")) {
                       jComboBoxSituacaoCheque.setSelectedIndex(1);
                   } else {
                       jComboBoxSituacaoCheque.setSelectedIndex(0);
                   }
                   jMoneyFieldChequeCadastro.setText(cheque.getValor_cheque().toString());
                  jLabelCheque.setText("Alterar Cheque");
                   jButtonAdicionaCheque.setText("Alterar");
                jDialogListaCheque.setLocationRelativeTo(jDialogListaCheque);
                jDialogListaCheque.setVisible(true);
           
           } else {

               jTextFieldComp1.setText("");
               jTextFieldBanco1.setText("");
               jTextFieldAgencia1.setText("");
               jTextFieldConta1.setText("");
               jTextFieldNumCheque1.setText("");
               jMoneyFieldChequeCadastro.setText("");
               jDateChooserChequeCadastro.setDate(null);
               jTextFieldEmitente.setText("");
               jLabelCheque.setText("Cheque");
               jButtonAdicionaCheque.setText("Adicionar");

               jButtonEditarCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
               jButtonEditarCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
           }
       } else {
           JOptionPane.showMessageDialog(null, "Favor selecionar o Cheque para ser alterado!");
       }
}//GEN-LAST:event_jButtonEditarChequeActionPerformed

   private void jButtonExcluiChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExcluiChequeActionPerformed
  if (jTableChequeCadastro.getSelectedRow() >= 0) {
       int linha = jTableChequeCadastro.getSelectedRow();

     
       int indice2 = (Integer)jTableChequeCadastro.getValueAt(linha, 0);
     
       //ChequesCadastrados.remove(indice2);
              DelCheque(indice2);              
              novo --;
              SomaChequesMov();
                CarregaTabelaChequeCadastro();
  }else {
           JOptionPane.showMessageDialog(null, "Por favor selecione um cheque para ser excluido!");
       }
       
   }//GEN-LAST:event_jButtonExcluiChequeActionPerformed

    private void jTableChequePagarPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTableChequePagarPropertyChange

//        CarregaChequePagar();
//        SomaChequesMov();
    }//GEN-LAST:event_jTableChequePagarPropertyChange

    private void jButtonOkChequePagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkChequePagarActionPerformed

        CarregaChequePagar();
        SomaChequesMov();          
        int numerocheques = jTableChequesMovimento.getRowCount();
        jTextField_Pagamento.setText(Integer.toString(numerocheques));
        jTextField_Pagamento.setEditable(false);
        jDialogListaChequePagar.setVisible(false);
    }//GEN-LAST:event_jButtonOkChequePagarActionPerformed

    private void jButtonCancelaChequePagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelaChequePagarActionPerformed

        jDialogListaChequePagar.setVisible(false);
    }//GEN-LAST:event_jButtonCancelaChequePagarActionPerformed

    private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked

    }//GEN-LAST:event_jTable1MouseClicked

    private void jButton_Deletar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_Deletar1ActionPerformed

        if (jTableChequesMovimento.getSelectedRow() >= 0) {
              ChequeDao cdao = new ChequeDao();
        try {
       
             int k = jTableChequesMovimento.getSelectedRow();                      
             int cod = (Integer) jTableChequesMovimento.getValueAt(k, 0);
             Cheque cheque2 = GetCheque(cod);

           if(cheque2.getStatus().equals("Excluir")){
              cheque2.setStatus("Cadastrado");
              SetCheque(cheque2.getCod_cheque(), cheque2);
              
           }else if(cheque2.getStatus().equals("Novo")){
              DelCheque(cod);              
              novo --;  
              SomaChequesMov();
           }else{
              cheque2.setStatus("Excluir");
              SetCheque(cheque2.getCod_cheque(), cheque2);
                   }                   
           CarregaTabelaChequeCadastro();

            } catch (Exception ex) {
                System.out.println("1 - Excluir linha jTable2" + ex.getMessage());
                JOptionPane.showMessageDialog(null, "Botao do Movimento jButton_Deletar1ActionPerformed");
            }
        } else {
            JOptionPane.showMessageDialog(null, "Favor selecionar um Cheque para ser removido!");
        }

    }//GEN-LAST:event_jButton_Deletar1ActionPerformed

    private void jButton_LimparMovActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LimparMovActionPerformed

            desejalancaroutro = 0;
            indexCaixa = -1;
            Lancamento.setText("Novo Lançamento");
            LimparTelaMovimento();
            //Limpa a tabela do Cheque
            jTextFieldComp1.setText("");
            jTextFieldBanco1.setText("");
            jTextFieldAgencia1.setText("");
            jTextFieldConta1.setText("");
            jTextFieldNumCheque1.setText("");
            jMoneyFieldChequeCadastro.setText("");
            jTextFieldEmitente.setText("");
            ControlAlteraCadastra = "1";
            jButton_Lancar.setText("Lançar");
            ChequesCadastrados.clear(); // limpa lista de cheques
            CarregaTabelaChequePagar(); 
    }//GEN-LAST:event_jButton_LimparMovActionPerformed

    private void jButton_LimparChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LimparChequeActionPerformed

        jTextFieldComp1.setText("");
        jTextFieldBanco1.setText("");
        jTextFieldAgencia1.setText("");
        jTextFieldConta1.setText("");
        jTextFieldNumCheque1.setText("");
        jMoneyFieldChequeCadastro.setText("");
        jDateChooser1.setDate(null);
        jTextFieldEmitente.setText("");
        jButtonAdicionaCheque.setText("Adicionar");
    }//GEN-LAST:event_jButton_LimparChequeActionPerformed

    private void jTextFieldCadEntCepActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCadEntCepActionPerformed
         
    }//GEN-LAST:event_jTextFieldCadEntCepActionPerformed

    private void jTextFieldDDDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldDDDActionPerformed
         
    }//GEN-LAST:event_jTextFieldDDDActionPerformed

    private void jTextFieldCadEntCpfFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCadEntCpfFocusLost
         
        if (jTextFieldCadEntCpf.getText().equals("   .   .   -  ")) {
            jTextFieldCadEntCpf.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldCadEntCpfFocusLost

    private void jTextFieldUFFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldUFFocusLost
         
        if (jTextFieldUF.getText().equals("  ")) {
            jTextFieldUF.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldUFFocusLost

    private void jTextFieldCadEntCepFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCadEntCepFocusLost
         
        if (jTextFieldCadEntCep.getText().equals("     -   ")) {
            jTextFieldCadEntCep.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldCadEntCepFocusLost

    private void jTextFieldDDDFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldDDDFocusLost
         
        if (jTextFieldDDD.getText().equals("(  )")) {
            jTextFieldDDD.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldDDDFocusLost

    private void jTextFieldCadEntTelefoneFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCadEntTelefoneFocusLost
         
        if (jTextFieldCadEntTelefone.getText().equals("    -    ")) {
            jTextFieldCadEntTelefone.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldCadEntTelefoneFocusLost

    private void jTextFieldCNPJFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCNPJFocusLost
         
        if (jTextFieldCNPJ.getText().equals("   .   .   /    -  ")) {
            jTextFieldCNPJ.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldCNPJFocusLost

    private void jTextFieldCadEntRgFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCadEntRgFocusLost
         
        if (jTextFieldCadEntRg.getText().equals("  .   .   - ")) {
            jTextFieldCadEntRg.setValue(null);
        }
    }//GEN-LAST:event_jTextFieldCadEntRgFocusLost

    private void jButtonLimpaEntidadeMovimentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLimpaEntidadeMovimentoActionPerformed

        jTextFieldCadEntNome.setText("");
        jTextFieldCadEntEndereco.setText("");
        jTextFieldCadEntBairro.setText("");
        jTextFieldUF.setValue(null);
        jTextFieldCadEntCidade.setText("");
        jTextFieldCadEntCep.setValue(null);
        jTextFieldDDD.setValue(null);
        jTextFieldCadEntTelefone.setValue(null);
        jTextFieldCadEntCpf.setValue(null);
        jTextFieldCadEntRg.setValue(null);
        jTextFieldCadEntObs.setText("");
        jTextFieldCadEntApelido.setText("");
        jTextFieldCadEntIE.setText("");
        jTextFieldCNPJ.setValue(null);
    }//GEN-LAST:event_jButtonLimpaEntidadeMovimentoActionPerformed

    private void jButtonLimparBancoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLimparBancoActionPerformed

        jTextFieldNomeBanco.setText("");
        jTextFieldAgenciaBanco.setText("");
        jTextFieldContaBanco.setText("");
    }//GEN-LAST:event_jButtonLimparBancoActionPerformed

    private void jButtonNovoLancamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNovoLancamentoActionPerformed

        jButtonEditar.setEnabled(true);//habilita  o acesso a edição de movimentos
        desejalancaroutro = 0;
        indexCaixa = -1;
        Lancamento.setText("Novo Lançamento");
        jComboBox_Caixa.setSelectedIndex((Integer) CaixasLancados.get(0));//volta a seleção para o primeiro caixa que foi lançado
        CaixasLancados.clear();//limpa a lista de caixas lançados

        // apaga alguns campos que foram usandos para um novo cadastro...
        jDateChooser1.setDate(null);
        jTextField_CodigoMov.setText("");
        cBox.setSelectedItem(null);
        jTextField_NomeMov.setText("");
        jMoneyFieldValor.setText("");
        jTextField_Pagamento.setText("");
        jTextField_Nome_Pagamento.setText("");
        cBox.setSelectedItem("");
        jRadioButton_Credito.setSelected(false);
        jRadioButton_Debito.setSelected(false);
        modelo2.setRowCount(0);
        jTableChequesMovimento.setModel(modelo2);
        jButtonNovoLancamento.setEnabled(false);
        

    }//GEN-LAST:event_jButtonNovoLancamentoActionPerformed

    private void jComboBox_Tipo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_Tipo1ActionPerformed
         
    }//GEN-LAST:event_jComboBox_Tipo1ActionPerformed

    private void jTextField_Nome1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_Nome1ActionPerformed
         
    }//GEN-LAST:event_jTextField_Nome1ActionPerformed

    private void jButtonTipo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTipo1ActionPerformed
         
    }//GEN-LAST:event_jButtonTipo1ActionPerformed

    private void jComboBox_Pagamento1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_Pagamento1ActionPerformed
         
    }//GEN-LAST:event_jComboBox_Pagamento1ActionPerformed

    private void jButtonPagamento1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPagamento1ActionPerformed
         
    }//GEN-LAST:event_jButtonPagamento1ActionPerformed

    private void jTextField_Codigo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_Codigo1ActionPerformed
         
    }//GEN-LAST:event_jTextField_Codigo1ActionPerformed

    private void jTextField_Codigo1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField_Codigo1FocusLost
         
    }//GEN-LAST:event_jTextField_Codigo1FocusLost

    private void jTextField_Pagamento1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField_Pagamento1FocusLost
         
    }//GEN-LAST:event_jTextField_Pagamento1FocusLost

    private void cBox1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cBox1MouseClicked
         
    }//GEN-LAST:event_cBox1MouseClicked

    private void cBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cBox1ActionPerformed
         
    }//GEN-LAST:event_cBox1ActionPerformed

    private void cBox1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cBox1KeyReleased
         
    }//GEN-LAST:event_cBox1KeyReleased

    private void jButtonHistorico1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonHistorico1ActionPerformed
         
    }//GEN-LAST:event_jButtonHistorico1ActionPerformed

    private void jMoneyField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMoneyField2ActionPerformed
         
    }//GEN-LAST:event_jMoneyField2ActionPerformed

    private void jComboBox_Caixa1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa1MouseClicked
         
    }//GEN-LAST:event_jComboBox_Caixa1MouseClicked

    private void jComboBox_Caixa1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa1MousePressed
         
    }//GEN-LAST:event_jComboBox_Caixa1MousePressed

    private void jComboBox_Caixa1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa1MouseReleased
         
    }//GEN-LAST:event_jComboBox_Caixa1MouseReleased

    private void jComboBox_Caixa1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox_Caixa1ItemStateChanged
         
    }//GEN-LAST:event_jComboBox_Caixa1ItemStateChanged

    private void jComboBox_Caixa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_Caixa1ActionPerformed
         
    }//GEN-LAST:event_jComboBox_Caixa1ActionPerformed

    private void jComboBox_Caixa2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa2MouseClicked
         
    }//GEN-LAST:event_jComboBox_Caixa2MouseClicked

    private void jComboBox_Caixa2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa2MousePressed
         
    }//GEN-LAST:event_jComboBox_Caixa2MousePressed

    private void jComboBox_Caixa2MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox_Caixa2MouseReleased
         
    }//GEN-LAST:event_jComboBox_Caixa2MouseReleased

    private void jComboBox_Caixa2ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox_Caixa2ItemStateChanged
         
    }//GEN-LAST:event_jComboBox_Caixa2ItemStateChanged

    private void jComboBox_Caixa2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_Caixa2ActionPerformed
         
    }//GEN-LAST:event_jComboBox_Caixa2ActionPerformed

    private void jButtonPesquisaAvancadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPesquisaAvancadaActionPerformed

        jDialogPesquisaAvancada.setLocationRelativeTo(jDialogPesquisaAvancada);
        jDialogPesquisaAvancada.setVisible(true);

    }//GEN-LAST:event_jButtonPesquisaAvancadaActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        jDialogPesquisaAvancada.setVisible(false);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButtonEditarChequesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarChequesActionPerformed
  
       if (jTableChequesMovimento.getSelectedRow() >= 0) {  
           
             int k = jTableChequesMovimento.getSelectedRow();
                   int cod_che = (Integer) jTableChequesMovimento.getValueAt(k, 0);
                   indiceTabelaCh = (Integer) jTableChequesMovimento.getValueAt(k, 0)-1;
                  cheque = GetCheque(cod_che);
             try {  
                   jTextFieldComp1.setText(cheque.getComp());
                   jTextFieldAgencia1.setText(cheque.getAgencia());
                   jTextFieldConta1.setText(cheque.getConta());
                   jTextFieldNumCheque1.setText(cheque.getNum_cheque());
                   jTextFieldBanco1.setText(cheque.getBanco());
                   jTextFieldEmitente.setText(cheque.getEmitente());
                   SimpleDateFormat formatIso = new SimpleDateFormat("yyyy-MM-dd");       
                   String date = (cheque.getData());           
                   Date datatabela = formatIso.parse(date); 
                   jDateChooserChequeCadastro.setDate(datatabela);
                   
                  } catch (ParseException ex) {
                   Logger.getLogger(FrameMovimento.class.getName()).log(Level.SEVERE, null, ex);
                   JOptionPane.showMessageDialog(null, "Botao do Movimento jButtonEditarChequesActionPerformed");
                  }
                  
                   if (cheque.getDevolvido().equals("sim")) {
                       jComboBoxSituacaoCheque.setSelectedIndex(1);
                   } else {
                       jComboBoxSituacaoCheque.setSelectedIndex(0);
                   }
                   jMoneyFieldChequeCadastro.setText(cheque.getValor_cheque().toString());
                   jLabelCheque.setText("Alterar Cheque");
                   jButtonAdicionaCheque.setText("Alterar");
                   jButtonEditarCheque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                   jButtonEditarCheque.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));

                jDialogListaCheque.setLocationRelativeTo(jDialogListaCheque);
                jDialogListaCheque.setVisible(true);
            
       }    
    }//GEN-LAST:event_jButtonEditarChequesActionPerformed

    private void jTextFieldPesquisaEntidadeDialogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldPesquisaEntidadeDialogActionPerformed
         
    }//GEN-LAST:event_jTextFieldPesquisaEntidadeDialogActionPerformed

    private void jTextFieldRazaoSocialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldRazaoSocialActionPerformed
         
    }//GEN-LAST:event_jTextFieldRazaoSocialActionPerformed

    private void jButtonVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltarActionPerformed
        BuscarLimiteAnterior();
        jButtonAvancar.setEnabled(true);
    }//GEN-LAST:event_jButtonVoltarActionPerformed

    private void jButtonEditar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditar1ActionPerformed
        if (jTable1.getSelectedRow() >= 0) {

            if (jLabelCaixa.getText().equals("Caixa")) {
                jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                int k = jTable1.getSelectedRow();
                codigo_novocaixa = (Integer) jTable1.getValueAt(k, 0);
                // falta pegar o ultimo codigo para editar
                CaixaDao udao = new CaixaDao();
                Caixa u = udao.PesquisarCaixa(codigo_novocaixa);

                jTextFieldNomeCaixa.setText(u.getCaixa());
                jTextFieldRazaoSocial.setText(u.getCxRazaoSocial());
                jTextFieldCidade.setText(u.getCxCidade());
                jTextFieldEndereço.setText(u.getCxEndereco());
                jTextFieldResponsavel.setText(u.getCxRespLegal());
                jTextFieldRegCivil.setText(u.getCxRegistro());
                jTextFieldEmpresa.setText(u.getCxNomeEmp());
                jTextFieldContador.setText(u.getCxContador());
                jLabelCaixa.setText("Alterar Caixa");
                jButtonCadastrar.setText("Alterar");
            } else {
                jTextFieldNomeCaixa.setText("");
                jTextFieldRazaoSocial.setText("");
                jTextFieldCidade.setText("");
                jTextFieldEndereço.setText("");
                jTextFieldResponsavel.setText("");
                jTextFieldRegCivil.setText("");
                jTextFieldEmpresa.setText("");
                jTextFieldContador.setText("");
                jLabelCaixa.setText("Caixa");
                jButtonCadastrar.setText("Cadastrar");
                jButtonEditar.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
                jButtonEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
            }
        } else {
            JOptionPane.showMessageDialog(null, "Favor selecionar o Caixa para ser alterado");
        }
    }//GEN-LAST:event_jButtonEditar1ActionPerformed

    private void jButtonAvancar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAvancar1ActionPerformed
        BuscarLimiteProximo();
        jButtonVoltar.setEnabled(true);
    }//GEN-LAST:event_jButtonAvancar1ActionPerformed

    private void jButtonRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoverActionPerformed

        int linha = jTable1.getSelectedRow();
        Object[] OPTIONS = {"Sim", "Não"};
        String caixa = jTable1.getValueAt(linha, 1).toString();
        CaixaDao cdao = new CaixaDao();
        Caixa c = new Caixa();
        c.setCaixa(caixa);
        try {
            int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja excluir o registro?", "Excluir", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);
            if (I == JOptionPane.YES_OPTION) {

                cdao.DeletarCaixa(c);
                JOptionPane.showMessageDialog(null, "Excluído com sucesso!");
                CarregarCaixaNovo();
            }
        } catch (Exception e) {
            System.out.println("1 - jButtonRemoveActionperformed " + e.getMessage());
            JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonRemoverActionPerformed");
        }
    }//GEN-LAST:event_jButtonRemoverActionPerformed

    private void jButtonCadastrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCadastrarActionPerformed

        if (jTextFieldNomeCaixa.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Favor preencher os campos!");
        } else {

            try {
                if (jLabelCaixa.getText().equals("Caixa")) {
                    Caixa c = new Caixa();
                    CaixaDao cdao = new CaixaDao();
                    DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();

                    c.setCaixa(jTextFieldNomeCaixa.getText());
                    c.setCxRazaoSocial(jTextFieldRazaoSocial.getText());
                    c.setCxCidade(jTextFieldCidade.getText());
                    c.setCxEndereco(jTextFieldEndereço.getText());
                    c.setCxRespLegal(jTextFieldResponsavel.getText());
                    c.setCxRegistro(jTextFieldRegCivil.getText());
                    c.setCxNomeEmp(jTextFieldEmpresa.getText());
                    c.setCxContador(jTextFieldContador.getText());
                    cdao.CadastrarCaixa(c);
                    //BuscarLimiteProximo();
                    
                    //modelo.addRow(new Object[]{codcaixa, c.getCaixa()});
                    CarregarCaixaNovo();
                    JOptionPane.showMessageDialog(null, "Cadastrado com sucesso!");
                            
                    jTable1.setModel(modelo);
                    jTextFieldNomeCaixa.setText("");
                    jTextFieldRazaoSocial.setText("");
                    jTextFieldCidade.setText("");
                    jTextFieldEndereço.setText("");
                    jTextFieldResponsavel.setText("");
                    jTextFieldRegCivil.setText("");
                    jTextFieldEmpresa.setText("");
                    jTextFieldContador.setText("");
                } else {
                    Object[] OPTIONS = {"Sim", "Não"};

                    int I = JOptionPane.showOptionDialog(null, "Tem certeza que deseja alterar o registro?", "Alterar", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, OPTIONS, OPTIONS[0]);
                    if (I == JOptionPane.YES_OPTION) {
                        Caixa c = new Caixa();
                        c.setCod_caixa(codigo_novocaixa);
                        c.setCaixa(jTextFieldNomeCaixa.getText());
                        c.setCxRazaoSocial(jTextFieldRazaoSocial.getText());
                        c.setCxCidade(jTextFieldCidade.getText());
                        c.setCxEndereco(jTextFieldEndereço.getText());
                        c.setCxRespLegal(jTextFieldResponsavel.getText());
                        c.setCxRegistro(jTextFieldRegCivil.getText());
                        c.setCxNomeEmp(jTextFieldEmpresa.getText());
                        c.setCxContador(jTextFieldContador.getText());

                        CaixaDao cdao = new CaixaDao();
                        cdao.AlterarCaixa(c);

                        jTextFieldNomeCaixa.setText("");
                        jTextFieldRazaoSocial.setText("");
                        jTextFieldCidade.setText("");
                        jTextFieldEndereço.setText("");
                        jTextFieldResponsavel.setText("");
                        jTextFieldRegCivil.setText("");
                        jTextFieldEmpresa.setText("");
                        jTextFieldContador.setText("");
                        jLabelCaixa.setText("Caixa");
                        jButtonCadastrar.setText("Cadastrar");
                    }
                    CarregarCaixaNovo();
                  }
            } catch (Exception e) {
                System.out.println("1 - jButtonCadastrarActionPerformed" + e.getMessage());
                JOptionPane.showMessageDialog(null, "Funcao do Movimento jButtonCadastrarActionPerformed");
            }
        }
    }//GEN-LAST:event_jButtonCadastrarActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        CarregarCaixaNovo();
        jButtonAvancar.setEnabled(true);
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButtonLimparCaixaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLimparCaixaActionPerformed
         
        jTextFieldNomeCaixa.setText("");
        jTextFieldRazaoSocial.setText("");
        jTextFieldCidade.setText("");
        jTextFieldEndereço.setText("");
        jTextFieldResponsavel.setText("");
        jTextFieldRegCivil.setText("");
        jTextFieldEmpresa.setText("");
        jTextFieldContador.setText("");
    }//GEN-LAST:event_jButtonLimparCaixaActionPerformed

    private void jButtonSairCaixaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSairCaixaActionPerformed
        
        jDialogNovoCaixa.setVisible(false);
        jTextFieldNomeCaixa.setText("");
        jTextFieldRazaoSocial.setText("");
        jTextFieldCidade.setText("");
        jTextFieldEndereço.setText("");
        jTextFieldResponsavel.setText("");
        jTextFieldRegCivil.setText("");
        jTextFieldEmpresa.setText("");
        jTextFieldContador.setText("");          
    }//GEN-LAST:event_jButtonSairCaixaActionPerformed

    private void jMoneyFieldValorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMoneyFieldValorActionPerformed
      
    }//GEN-LAST:event_jMoneyFieldValorActionPerformed

    private void jButtonHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonHistoricoActionPerformed
         
        jDialogListaHistorico.setLocationRelativeTo(jDialogListaHistorico);
        jDialogListaHistorico.setVisible(true);
        
    }//GEN-LAST:event_jButtonHistoricoActionPerformed

    private void cBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cBoxActionPerformed
       
    if(atualizahistorico == 1){
          ListaHistorico();
      }
          atualizahistorico = 0;
    }//GEN-LAST:event_cBoxActionPerformed

    private void cBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cBoxMouseClicked
         
    }//GEN-LAST:event_cBoxMouseClicked

    private void jTextField_CodigoMovFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField_CodigoMovFocusLost

      if(jTextField_CodigoMov.getText().equals("")){
          
      }else{
        try{
            
            Integer.parseInt(jTextField_CodigoMov.getText());  
            PreencheoNomedaEntidade();//preenche o nome da entidade quando selecionado o codigo
            
           } catch (NumberFormatException e) {  
              jTextField_CodigoMov.setText("");
              jTextField_NomeMov.setText("");
              jTextField_CodigoMov.requestFocus();  
       }
      }
    }//GEN-LAST:event_jTextField_CodigoMovFocusLost

    private void jTextField_CodigoMovActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_CodigoMovActionPerformed
 
    }//GEN-LAST:event_jTextField_CodigoMovActionPerformed

    private void jButtonPagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPagamentoActionPerformed
         
        if (jComboBox_Pagamento.getSelectedIndex() == 0) {
            if (jLabel12.getText().equals("Pagamento:")) {// Abre a tela de chequepagar para selecionar o cheque a ser usado
               
                if(jDialogListaChequePagar.isVisible()==false){
                jDialogListaChequePagar.setLocationRelativeTo(jDialogListaChequePagar);
                jDialogListaChequePagar.setVisible(true); 
                }else{      
                CarregaTabelaChequePagar();              
                jDialogListaChequePagar.setLocationRelativeTo(jDialogListaChequePagar);
                jDialogListaChequePagar.setVisible(true);
                }
            } else {
                jDialogListaCheque.setLocationRelativeTo(jDialogListaCheque);
                jDialogListaCheque.setVisible(true);
            }}
        else if(jComboBox_Pagamento.getSelectedIndex() == 1){
                
         jDialogListaBanco.setLocationRelativeTo(jDialogListaBanco);
         jDialogListaBanco.setVisible(true);
    }       
    }//GEN-LAST:event_jButtonPagamentoActionPerformed

    private void jComboBox_PagamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_PagamentoActionPerformed
         
      if((jComboBox_Pagamento.getSelectedIndex() == 0)&&( jComboBox_Tipo.getSelectedIndex()==2)){ //quando for cheque e outros

            jTextField_Nome_Pagamento.setText("");
            jTextField_Pagamento.setEnabled(false);
            jTextField_Nome_Pagamento.setEditable(false);
            jButtonPagamento.setEnabled(false);   
            jMoneyFieldValor.setEnabled(false);
            CarregaTabelaChequeCadastro();
    }     
        else if (jComboBox_Pagamento.getSelectedIndex() == 2) { //Pagamento = dinheiro
            jTextField_Pagamento.setText("0");
            jTextField_Nome_Pagamento.setText("");
            jTextField_Pagamento.setEnabled(false);
            jTextField_Nome_Pagamento.setEditable(false);
            jButtonPagamento.setEnabled(false);
            jMoneyFieldValor.setEnabled(true);
             modelo2.setRowCount(0);
            jTableChequesMovimento.setModel(modelo2);
        
        } else if (jComboBox_Pagamento.getSelectedIndex() == 0) {//pagamento=cheque
            jTextField_Pagamento.setText("");
            jTextField_Nome_Pagamento.setText("");
            jTextField_Pagamento.setEnabled(false);
            jTextField_Nome_Pagamento.setEditable(false);
            jButtonPagamento.setEnabled(true);
            jButtonPagamento.requestFocus();
            System.out.println("antes");
            jMoneyFieldValor.setEnabled(false); 
            System.out.println("depoi");
            CarregaTabelaChequeCadastro();
            
        } else if(jComboBox_Pagamento.getSelectedIndex() == 1) {//pagamento = banco
            jTextField_Nome_Pagamento.setText("");
            jTextField_Pagamento.setText("");
            jTextField_Pagamento.setEnabled(true);
            jTextField_Nome_Pagamento.setEditable(false);
            jButtonPagamento.setEnabled(true);
            jMoneyFieldValor.setEnabled(true);
             modelo2.setRowCount(0);
            jTableChequesMovimento.setModel(modelo2);
              
        } 
    }//GEN-LAST:event_jComboBox_PagamentoActionPerformed

    private void jButtonTipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonTipoActionPerformed
         
        jDialogListaEntidade.setLocationRelativeTo(jDialogListaEntidade);
        jDialogListaEntidade.setVisible(true);
    }//GEN-LAST:event_jButtonTipoActionPerformed

    private void jComboBox_TipoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox_TipoActionPerformed
         
        if (jComboBox_Tipo.getSelectedIndex() == 0) {
            jLabel12.setText("Recebimento:");
            jRadioButton_Credito.setEnabled(true);
            jRadioButton_Credito.setSelected(true);
            jRadioButton_Debito.setEnabled(false);
            jMoneyFieldValor.setText("");
            jTextField_Pagamento.setText("");
            jTextField_CodigoMov.setText("");
            jTextField_NomeMov.setText("");
            jTextField_CodigoMov.setEnabled(true);
            jButtonTipo.setEnabled(true);
            jButtonPagamento.setEnabled(true);
            jButtonEditarCheques.setEnabled(true);
            
        } else if (jComboBox_Tipo.getSelectedIndex() == 1) {
            jLabel12.setText("Pagamento:");
            jRadioButton_Debito.setEnabled(true);
            jRadioButton_Debito.setSelected(true);
            jRadioButton_Credito.setEnabled(false);
            jMoneyFieldValor.setText("");
            jButtonPagamento.setEnabled(true);
            jTextField_Pagamento.setText("");
            jTextField_CodigoMov.setText("");
            jTextField_NomeMov.setText("");
            jTextField_CodigoMov.setEnabled(true);
            jButtonTipo.setEnabled(true);      
            jButtonEditarCheques.setEnabled(false);
        } 
        else if (jComboBox_Tipo.getSelectedIndex() == 2) {
            jLabel12.setText("Pagamento:");
            jRadioButton_Credito.setEnabled(true);
            jRadioButton_Credito.setSelected(true);
            jRadioButton_Debito.setEnabled(false);
            jTextField_CodigoMov.setText("1");
            jTextField_NomeMov.setText("OUTROS");
            jTextField_CodigoMov.setEnabled(false);
            jButtonTipo.setEnabled(false);
           // jComboBox_Pagamento.setSelectedIndex(1);
            jButtonEditarCheques.setEnabled(false);
        }
        //--> Zera a tabela de cheques
        modelo2 = (DefaultTableModel) jTableChequesMovimento.getModel();
        modelo2.setRowCount(0);
        jTableChequesMovimento.setModel(modelo2);
    }//GEN-LAST:event_jComboBox_TipoActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
         
        jDialogConsultaCheque.setLocationRelativeTo(jDialogConsultaCheque);
        jDialogConsultaCheque.setVisible(true);

    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButtonVoltar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVoltar1ActionPerformed
        limitepesquisacheque = limitepesquisacheque - 200;
        ChequeDao edao = new ChequeDao();   
        PesquisaCheque e = GetValorePesquisaCheque();
        List<Cheque> listack = edao.PesquisarChequeAvancada(e, limitepesquisacheque);// funcao que pesquisa os cheques     
        if (listack.size() < 200) {
            jButtonVoltar1.setEnabled(false);
        }
        CarregarChequePesquisaAvancada(listack);
        jButtonAvancar2.setEnabled(true);
    }//GEN-LAST:event_jButtonVoltar1ActionPerformed

    private void jButtonAvancar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAvancar2ActionPerformed
   
      //  BuscarLimiteProximoPesquisaAvancadaCheque();
        limitepesquisacheque = limitepesquisacheque + 200;
        ChequeDao edao = new ChequeDao();   
        PesquisaCheque e = GetValorePesquisaCheque();
        List<Cheque> listack = edao.PesquisarChequeAvancada(e, limitepesquisacheque);// funcao que pesquisa os cheques     
        if (listack.size() < 200) {
            jButtonAvancar2.setEnabled(false);
        }        
        CarregarChequePesquisaAvancada(listack);
        jButtonVoltar1.setEnabled(true);
    }//GEN-LAST:event_jButtonAvancar2ActionPerformed

    private void jTextFieldPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldPesquisarKeyReleased
 
        CarregarLetraCheque();
    }//GEN-LAST:event_jTextFieldPesquisarKeyReleased

    private void jTextFieldCompActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCompActionPerformed
         
    }//GEN-LAST:event_jTextFieldCompActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
//        CarregarCheque();
//        jButtonAvancar.setEnabled(true);
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jTextField_NomeMovActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField_NomeMovActionPerformed
         
    }//GEN-LAST:event_jTextField_NomeMovActionPerformed

    private void cBoxPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_cBoxPropertyChange
        
    }//GEN-LAST:event_cBoxPropertyChange

    private void jTextField_CodigoMovKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField_CodigoMovKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField_CodigoMovKeyPressed

    private void jTableChequePagarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableChequePagarMouseClicked
       
    }//GEN-LAST:event_jTableChequePagarMouseClicked

    private void cBoxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_cBoxKeyPressed
  HistoricoMaiusculo(cBox.getSelectedItem().toString());      
    }//GEN-LAST:event_cBoxKeyPressed

    private void jButtonEditarHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEditarHistoricoActionPerformed
     
           if (jTableHistorico.getSelectedRow() >= 0) {
            if (jLabelHistorico.getText().equals("Historico")) {
                jButtonEditarHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
                jButtonEditarHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/removeicon.png")));
            int k = jTableHistorico.getSelectedRow();
           cod_historico_edita = (Integer) jTableHistorico.getValueAt(k, 0);

            HistoricoDao hdao = new HistoricoDao();
            Historico h = hdao.PesquisarHistorico(cod_historico_edita);

            jTextFieldDialogPesquisaHistorico.setText(h.getHistorico());
            jLabelHistorico.setText("Alterar Historico");
            jButtonCadastrarHistorico.setText("Alterar");
            }else{
                        jTextFieldDialogPesquisaHistorico.setText("");
                        jTextFieldDialogPesquisaHistorico.requestFocus();
                        jLabelHistorico.setText("Historico");
                        jButtonCadastrarHistorico.setText("Cadastrar");  
                jButtonEditarHistorico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil.png")));
                jButtonEditarHistorico.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/pencil[2]over.png")));
            }           
            } else {
            JOptionPane.showMessageDialog(this, "Favor selecionar o Historico para ser alterado");
        }
        
    }//GEN-LAST:event_jButtonEditarHistoricoActionPerformed

    private void jTextFieldDialogPesquisaHistoricoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldDialogPesquisaHistoricoActionPerformed
        // TODO add your handling code here:
        novohistorico = "";
    }//GEN-LAST:event_jTextFieldDialogPesquisaHistoricoActionPerformed

    private void jTextField_PagamentoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField_PagamentoFocusLost

        if (jComboBox_Pagamento.getSelectedIndex() == 0) {
            ChequeDao cdao = new ChequeDao();
            int cod_chequ = Integer.parseInt(jTextField_Pagamento.getText());
            int variavel = cdao.PesquisarChequeMov(cod_chequ); // chama a funcao passando o valor
            if (variavel == 0) {
                JOptionPane.showMessageDialog(null, "Codigo Inexistente \n Adicione um codigo válido para Cheque!");
            }
        } else {
            BancoDao bdao = new BancoDao();
            int cod_banco = Integer.parseInt(jTextField_Pagamento.getText());
            int variavel = bdao.PesquisarBancoMov(cod_banco);
            if (variavel == 0) {
                JOptionPane.showMessageDialog(null, "Codigo Inexistente \n Adicione um codigo válido para Banco!");
            }
        }
    }//GEN-LAST:event_jTextField_PagamentoFocusLost

    private void jButtonPesquisaAvancadaChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPesquisaAvancadaChequeActionPerformed
      
        ChequeDao edao = new ChequeDao();   
        PesquisaCheque e = GetValorePesquisaCheque();
        List<Cheque> listack = edao.PesquisarChequeAvancada(e, 0);// funcao que pesquisa os cheques     
         CarregarChequePesquisaAvancada(listack);
         
    }//GEN-LAST:event_jButtonPesquisaAvancadaChequeActionPerformed

    private void jTextFieldCodigoChequeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldCodigoChequeActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldCodigoChequeActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new FrameMovimento().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Lancamento;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JComboBox cBox;
    private javax.swing.JComboBox cBox1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JButton jButtonAdicionaCheque;
    private javax.swing.JButton jButtonAnteriorEntidade;
    private javax.swing.JButton jButtonAtualizaBanco;
    private javax.swing.JButton jButtonAtualizaEntidade;
    private javax.swing.JButton jButtonAtualizaHistorico;
    private javax.swing.JButton jButtonAtualizar;
    private javax.swing.JButton jButtonAvancaCadBanco;
    private javax.swing.JButton jButtonAvancaHistorico;
    private javax.swing.JButton jButtonAvancar;
    private javax.swing.JButton jButtonAvancar1;
    private javax.swing.JButton jButtonAvancar2;
    private javax.swing.JButton jButtonCadastraBanco;
    private javax.swing.JButton jButtonCadastrar;
    private javax.swing.JButton jButtonCadastrarEntidadeMovimento;
    private javax.swing.JButton jButtonCadastrarHistorico;
    private javax.swing.JButton jButtonCancelaChequePagar;
    private javax.swing.JButton jButtonEditar;
    private javax.swing.JButton jButtonEditar1;
    private javax.swing.JButton jButtonEditarCheque;
    private javax.swing.JButton jButtonEditarCheques;
    private javax.swing.JButton jButtonEditarHistorico;
    private javax.swing.JButton jButtonExcluiCheque;
    private javax.swing.JButton jButtonHistorico;
    private javax.swing.JButton jButtonHistorico1;
    private javax.swing.JButton jButtonLimpaEntidadeMovimento;
    private javax.swing.JButton jButtonLimparBanco;
    private javax.swing.JButton jButtonLimparCaixa;
    private javax.swing.JButton jButtonNovoBanco;
    private javax.swing.JButton jButtonNovoEntidade;
    private javax.swing.JButton jButtonNovoLancamento;
    private javax.swing.JButton jButtonOkBanco;
    private javax.swing.JButton jButtonOkChequePagar;
    private javax.swing.JButton jButtonOkEntidade;
    private javax.swing.JButton jButtonOkHistorico;
    private javax.swing.JButton jButtonPagamento;
    private javax.swing.JButton jButtonPagamento1;
    private javax.swing.JButton jButtonPesquisaAvancada;
    private javax.swing.JButton jButtonPesquisaAvancadaCheque;
    private javax.swing.JButton jButtonProximoEntidade;
    private javax.swing.JButton jButtonRemover;
    private javax.swing.JButton jButtonSairCaixa;
    private javax.swing.JButton jButtonTipo;
    private javax.swing.JButton jButtonTipo1;
    private javax.swing.JButton jButtonVolta;
    private javax.swing.JButton jButtonVoltaBanco;
    private javax.swing.JButton jButtonVoltaCadBanco;
    private javax.swing.JButton jButtonVoltaCadastraBanco;
    private javax.swing.JButton jButtonVoltaCheque;
    private javax.swing.JButton jButtonVoltaEntidadeMovimento;
    private javax.swing.JButton jButtonVoltaHistorico;
    private javax.swing.JButton jButtonVoltar;
    private javax.swing.JButton jButtonVoltar1;
    private javax.swing.JButton jButtonVoltarEntidade;
    private javax.swing.JButton jButtonVoltarHistorico;
    private javax.swing.JButton jButton_Cancelar;
    private javax.swing.JButton jButton_Deletar;
    private javax.swing.JButton jButton_Deletar1;
    private javax.swing.JButton jButton_Lancar;
    private javax.swing.JButton jButton_LimparCheque;
    private javax.swing.JButton jButton_LimparMov;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBoxSituacaoCheque;
    private javax.swing.JComboBox jComboBox_Caixa;
    private javax.swing.JComboBox jComboBox_Caixa1;
    private javax.swing.JComboBox jComboBox_Caixa2;
    private javax.swing.JComboBox jComboBox_Pagamento;
    private javax.swing.JComboBox jComboBox_Pagamento1;
    private javax.swing.JComboBox jComboBox_Tipo;
    private javax.swing.JComboBox jComboBox_Tipo1;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private com.toedter.calendar.JDateChooser jDateChooser2;
    private com.toedter.calendar.JDateChooser jDateChooser3;
    private com.toedter.calendar.JDateChooser jDateChooserChequeCadastro;
    private com.toedter.calendar.JDateChooser jDateEntradaFinal;
    private com.toedter.calendar.JDateChooser jDateEntradaInicial;
    private com.toedter.calendar.JDateChooser jDatePreFinal;
    private com.toedter.calendar.JDateChooser jDatePreInicial;
    private com.toedter.calendar.JDateChooser jDateSaidaFinal;
    private com.toedter.calendar.JDateChooser jDateSaidaInicial;
    private javax.swing.JDialog jDialogCadBanco;
    private javax.swing.JDialog jDialogCadEntidade;
    private javax.swing.JDialog jDialogConsultaCheque;
    private javax.swing.JDialog jDialogEntCheque;
    private javax.swing.JDialog jDialogListaBanco;
    private javax.swing.JDialog jDialogListaCheque;
    private javax.swing.JDialog jDialogListaChequePagar;
    private javax.swing.JDialog jDialogListaEntidade;
    private javax.swing.JDialog jDialogListaHistorico;
    private javax.swing.JDialog jDialogNovoCaixa;
    private javax.swing.JDialog jDialogPesquisaAvancada;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelAgencia;
    private javax.swing.JLabel jLabelAgencia1;
    private javax.swing.JLabel jLabelAgenciaBanco;
    private javax.swing.JLabel jLabelBanco;
    private javax.swing.JLabel jLabelBanco1;
    private javax.swing.JLabel jLabelCaixa;
    private javax.swing.JLabel jLabelCheque;
    private javax.swing.JLabel jLabelCheque1;
    private javax.swing.JLabel jLabelCidade;
    private javax.swing.JLabel jLabelComp;
    private javax.swing.JLabel jLabelComp1;
    private javax.swing.JLabel jLabelComp2;
    private javax.swing.JLabel jLabelConta;
    private javax.swing.JLabel jLabelConta1;
    private javax.swing.JLabel jLabelContaBanco;
    private javax.swing.JLabel jLabelContador;
    private javax.swing.JLabel jLabelData;
    private javax.swing.JLabel jLabelData1;
    private javax.swing.JLabel jLabelData2;
    private javax.swing.JLabel jLabelDevolvido;
    private javax.swing.JLabel jLabelDevolvido1;
    private javax.swing.JLabel jLabelEmpresa;
    private javax.swing.JLabel jLabelEndereço;
    private javax.swing.JLabel jLabelHistorico;
    private javax.swing.JLabel jLabelNome;
    private javax.swing.JLabel jLabelNomeBanco;
    private javax.swing.JLabel jLabelNumCheque;
    private javax.swing.JLabel jLabelNumCheque1;
    private javax.swing.JLabel jLabelOrigem;
    private javax.swing.JLabel jLabelOrigem1;
    private javax.swing.JLabel jLabelOrigem2;
    private javax.swing.JLabel jLabelOrigem3;
    private javax.swing.JLabel jLabelOrigem4;
    private javax.swing.JLabel jLabelOrigem5;
    private javax.swing.JLabel jLabelPesquisaBanco;
    private javax.swing.JLabel jLabelPesquisaEntidadeDialog;
    private javax.swing.JLabel jLabelPesquisar;
    private javax.swing.JLabel jLabelRazaoSocial;
    private javax.swing.JLabel jLabelRegCivil;
    private javax.swing.JLabel jLabelResponsavelLegal;
    private javax.swing.JLabel jLabelValor;
    private javax.swing.JLabel jLabelValor1;
    private br.com.GUI.caixa.JMoneyField jMoneyField2;
    private br.com.GUI.caixa.JMoneyField jMoneyFieldChequeCadastro;
    private br.com.GUI.caixa.JMoneyField jMoneyFieldChequePesquisa;
    private br.com.GUI.caixa.JMoneyField jMoneyFieldValor;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JRadioButton jRadioButton_Credito;
    private javax.swing.JRadioButton jRadioButton_Credito1;
    private javax.swing.JRadioButton jRadioButton_Debito;
    private javax.swing.JRadioButton jRadioButton_Debito1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTableBanco;
    private javax.swing.JTable jTableCaixaNovo;
    private javax.swing.JTable jTableChequeCadastro;
    private javax.swing.JTable jTableChequePagar;
    private javax.swing.JTable jTableChequesMovimento;
    private javax.swing.JTable jTableConsultaCheque;
    private javax.swing.JTable jTableEntidade;
    private javax.swing.JTable jTableEntidadeCheque;
    private javax.swing.JTable jTableHistorico;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextFieldAgencia;
    private javax.swing.JTextField jTextFieldAgencia1;
    private javax.swing.JTextField jTextFieldAgenciaBanco;
    private javax.swing.JTextField jTextFieldBanco;
    private javax.swing.JTextField jTextFieldBanco1;
    private javax.swing.JFormattedTextField jTextFieldCNPJ;
    private javax.swing.JTextField jTextFieldCadEntApelido;
    private javax.swing.JTextField jTextFieldCadEntBairro;
    private javax.swing.JFormattedTextField jTextFieldCadEntCep;
    private javax.swing.JTextField jTextFieldCadEntCidade;
    private javax.swing.JFormattedTextField jTextFieldCadEntCpf;
    private javax.swing.JTextField jTextFieldCadEntEndereco;
    private javax.swing.JTextField jTextFieldCadEntIE;
    private javax.swing.JTextField jTextFieldCadEntNome;
    private javax.swing.JTextField jTextFieldCadEntObs;
    private javax.swing.JFormattedTextField jTextFieldCadEntRg;
    private javax.swing.JFormattedTextField jTextFieldCadEntTelefone;
    private javax.swing.JTextField jTextFieldCidade;
    private javax.swing.JTextField jTextFieldCodigoCheque;
    private javax.swing.JTextField jTextFieldComp;
    private javax.swing.JTextField jTextFieldComp1;
    private javax.swing.JTextField jTextFieldConta;
    private javax.swing.JTextField jTextFieldConta1;
    private javax.swing.JTextField jTextFieldContaBanco;
    private javax.swing.JTextField jTextFieldContador;
    private javax.swing.JFormattedTextField jTextFieldDDD;
    private javax.swing.JTextField jTextFieldDialogPesquisaBanco;
    private javax.swing.JTextField jTextFieldDialogPesquisaHistorico;
    private javax.swing.JTextField jTextFieldEmitente;
    private javax.swing.JTextField jTextFieldEmitentePesquisa;
    private javax.swing.JTextField jTextFieldEmpresa;
    private javax.swing.JTextField jTextFieldEndereço;
    private javax.swing.JTextField jTextFieldNomeBanco;
    private javax.swing.JTextField jTextFieldNomeCaixa;
    private javax.swing.JTextField jTextFieldNumCheque;
    private javax.swing.JTextField jTextFieldNumCheque1;
    private javax.swing.JTextField jTextFieldPesquisaEntidadeDialog;
    private javax.swing.JTextField jTextFieldPesquisar;
    private javax.swing.JTextField jTextFieldRazaoSocial;
    private javax.swing.JTextField jTextFieldRegCivil;
    private javax.swing.JTextField jTextFieldResponsavel;
    private javax.swing.JFormattedTextField jTextFieldUF;
    private javax.swing.JTextField jTextField_Codigo1;
    private javax.swing.JTextField jTextField_CodigoMov;
    private javax.swing.JTextField jTextField_Nome1;
    private javax.swing.JTextField jTextField_NomeMov;
    private javax.swing.JTextField jTextField_Nome_Pagamento;
    private javax.swing.JTextField jTextField_Nome_Pagamento1;
    private javax.swing.JTextField jTextField_Pagamento;
    private javax.swing.JTextField jTextField_Pagamento1;
    private javax.swing.JTextField jTextField_Pesquisa;
    private javax.swing.JTextField jTextField_Saldo;
    // End of variables declaration//GEN-END:variables
}
